{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "68aadfb2",
   "metadata": {},
   "source": [
    "## Anaconda\n",
    "Anaconda 是一个用于科学计算的 Python 发行版，支持 Linux, Mac, Windows, 包含了众多流行的科学计算、数据分析的 Python 包。\n",
    "\n",
    "Anaconda 安装包可以到 https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ 下载。\n",
    "\n",
    "```shell\n",
    "jupyter notebook\n",
    "```\n",
    "\n",
    "##  1. 基础语法\n",
    "Python 中的变量不需要声明。每个变量在使用前都必须赋值，变量赋值以后该变量才会被创建。\n",
    "在 Python 中，变量就是变量，它没有类型，我们所说的\"类型\"是变量所指的内存中对象的类型。\n",
    "等号（=）用来给变量赋值。\n",
    "等号（=）运算符左边是一个变量名,等号（=）运算符右边是存储在变量中的值。例如："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "1a591873",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "100\n",
      "1000.0\n",
      "runoob\n"
     ]
    }
   ],
   "source": [
    "counter = 100          # 整型变量\n",
    "miles   = 1000.0       # 浮点型变量\n",
    "name    = \"runoob\"     # 字符串\n",
    "\n",
    "print (counter)\n",
    "print (miles)\n",
    "print (name)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "147f1cec",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1 - c 的值为： 31\n",
      "2 - c 的值为： 11\n",
      "3 - c 的值为： 210\n",
      "4 - c 的值为： 2.1\n",
      "5 - c 的值为： 1\n",
      "6 - c 的值为： 8\n",
      "7 - c 的值为： 2\n"
     ]
    }
   ],
   "source": [
    "# 常用的运算符\n",
    "a = 21\n",
    "b = 10\n",
    "c = 0\n",
    "print (\"1 - c 的值为：\", c)\n",
    " \n",
    "c = a - b\n",
    "print (\"2 - c 的值为：\", c)\n",
    " \n",
    "c = a * b\n",
    "print (\"3 - c 的值为：\", c)\n",
    " \n",
    "c = a / b\n",
    "print (\"4 - c 的值为：\", c)\n",
    " \n",
    "c = a % b\n",
    "print (\"5 - c 的值为：\", c)\n",
    " \n",
    "# 修改变量 a 、b 、c\n",
    "a = 2\n",
    "b = 3\n",
    "c = a**b \n",
    "print (\"6 - c 的值为：\", c)\n",
    " \n",
    "a = 10\n",
    "b = 5\n",
    "c = a//b \n",
    "print (\"7 - c 的值为：\", c)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "eb2e690e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1 - a 不等于 b\n",
      "2 - a 不等于 b\n",
      "3 - a 大于等于 b\n",
      "4 - a 大于 b\n",
      "5 - a 小于等于 b\n",
      "6 - b 大于等于 a\n"
     ]
    }
   ],
   "source": [
    "# 比较运算符\n",
    "a = 21\n",
    "b = 10\n",
    "c = 0\n",
    " \n",
    "if ( a == b ):\n",
    "    print (\"1 - a 等于 b\")\n",
    "else:\n",
    "    print (\"1 - a 不等于 b\")\n",
    " \n",
    "if ( a != b ):\n",
    "    print (\"2 - a 不等于 b\")\n",
    "else:\n",
    "    print (\"2 - a 等于 b\")\n",
    "\n",
    "if ( a < b ):\n",
    "    print (\"3 - a 小于 b\")\n",
    "else:\n",
    "    print (\"3 - a 大于等于 b\")\n",
    " \n",
    "if ( a > b ):\n",
    "    print (\"4 - a 大于 b\")\n",
    "else:\n",
    "    print (\"4 - a 小于等于 b\")\n",
    " \n",
    "# 修改变量 a 和 b 的值\n",
    "a = 5\n",
    "b = 20\n",
    "if ( a <= b ):\n",
    "   print (\"5 - a 小于等于 b\")\n",
    "else:\n",
    "   print (\"5 - a 大于  b\")\n",
    " \n",
    "if ( b >= a ):\n",
    "   print (\"6 - b 大于等于 a\")\n",
    "else:\n",
    "   print (\"6 - b 小于 a\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "69c8ad80",
   "metadata": {},
   "source": [
    "### Number（数字）\n",
    "Python3 支持 int、float、bool、complex（复数）。\n",
    "在Python 3里，只有一种整数类型 int，表示为长整型，没有 python2 中的 Long。\n",
    "像大多数语言一样，数值类型的赋值和计算都是很直观的。\n",
    "\n",
    "内置的 type() 函数可以用来查询变量所指的对象类型。\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "7a6e0904",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'int'> <class 'float'> <class 'bool'> <class 'complex'>\n"
     ]
    }
   ],
   "source": [
    "a, b, c, d = 20, 5.5, True, 4+3j\n",
    "print(type(a), type(b), type(c), type(d))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "13bcc4d6",
   "metadata": {},
   "source": [
    "### String（字符串）\n",
    "Python中的字符串用单引号 ' 或双引号 \" 括起来，同时使用反斜杠 \\ 转义特殊字符。\n",
    "字符串的截取的语法格式如下：\n",
    "<img src='https://static.runoob.com/wp-content/uploads/123456-20200923-1.svg' align='left' style=' width:500px;height:300 px'/>\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "61f0b994",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Runoob\n",
      "R\n",
      "noo\n",
      "noob\n",
      "RunoobTEST\n"
     ]
    }
   ],
   "source": [
    "str = 'Runoob' # \"zhangsan\"\n",
    "\n",
    "print (str)          # 输出字符串\n",
    "print (str[0])       # 输出字符串第一个字符\n",
    "print (str[2:5])     # 输出从第三个开始到第五个的字符\n",
    "print (str[2:])      # 输出从第三个开始的后的所有字符\n",
    "print (str + \"TEST\") # 连接字符串\n",
    "# str[start:end] "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0bd74817",
   "metadata": {},
   "source": [
    "### List（列表）\n",
    "List（列表） 是 Python 中使用最频繁的数据类型。\n",
    "\n",
    "列表可以完成大多数集合类的数据结构实现。列表中元素的类型可以不相同，它支持数字，字符串甚至可以包含列表（所谓嵌套）。\n",
    "\n",
    "列表是写在方括号 [] 之间、用逗号分隔开的元素列表。\n",
    "和字符串一样，列表同样可以被索引和截取，列表被截取后返回一个包含所需元素的新列表。\n",
    "\n",
    "<img src='https://www.runoob.com/wp-content/uploads/2014/08/list_slicing1_new1.png' align='left' style=' width:500px;height:300 px'/>\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "56535ada",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['abcd', 786, 2.23, 'runoob', 70.2]\n",
      "abcd\n",
      "[786, 2.23]\n",
      "[2.23, 'runoob', 70.2]\n",
      "['abcd', 786, 2.23, 'runoob', 70.2, 123, 'runoob']\n"
     ]
    }
   ],
   "source": [
    "list = [ 'abcd', 786 , 2.23, 'runoob', 70.2 ]\n",
    "tinylist = [123, 'runoob']\n",
    "# list[start:end]\n",
    "list = [[1,2,3],[4,5,6], 4]\n",
    "print (list)            # 输出完整列表\n",
    "print (list[0])         # 输出列表第一个元素\n",
    "print (list[1:3])       # 从第二个开始输出到第三个元素\n",
    "print (list[2:])        # 输出从第三个元素开始的所有元素\n",
    "print (list + tinylist) # 连接列表"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "18fc7f87",
   "metadata": {},
   "source": [
    "### Tuple（元组）\n",
    "元组（tuple）与列表类似，不同之处在于元组的元素不能修改。元组写在小括号 () 里，元素之间用逗号隔开。\n",
    "\n",
    "元组中的元素类型也可以不相同："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "cd1d3e14",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('abcd', 786, 2.23, 'runoob', 70.2)\n",
      "abcd\n",
      "(786, 2.23)\n",
      "(2.23, 'runoob', 70.2)\n",
      "('abcd', 786, 2.23, 'runoob', 70.2, 123, 'runoob')\n"
     ]
    }
   ],
   "source": [
    "tuple = ( 'abcd', 786 , 2.23, 'runoob', 70.2  )\n",
    "tinytuple = (123, 'runoob')\n",
    "\n",
    "print (tuple)             # 输出完整元组\n",
    "print (tuple[0])          # 输出元组的第一个元素\n",
    "print (tuple[1:3])        # 输出从第二个元素开始到第三个元素\n",
    "print (tuple[2:])         # 输出从第三个元素开始的所有元素\n",
    "print (tuple + tinytuple) # 连接元组"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5a2dc218",
   "metadata": {},
   "source": [
    "### Set（集合）\n",
    "集合（set）是由一个或数个形态各异的大小整体组成的，构成集合的事物或对象称作元素或是成员。\n",
    "基本功能是进行成员关系测试和删除重复元素。\n",
    "可以使用大括号 { } 或者 set() 函数创建集合，注意：创建一个空集合必须用 set() 而不是 { }，因为 { } 是用来创建一个空字典。\n",
    "创建格式："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "c43309d6",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'Facebook', 'Taobao', 'Google', 'Baidu', 'Runoob', 'Zhihu'}\n",
      "Google 在集合中\n",
      "{'r', 'b', 'c', 'a', 'd'}\n",
      "{'l', 'm', 'z', 'c', 'a'}\n",
      "{'d', 'b', 'r'}\n",
      "{'l', 'r', 'm', 'b', 'z', 'c', 'a', 'd'}\n",
      "{'a', 'c'}\n",
      "{'l', 'r', 'm', 'd', 'b', 'z'}\n"
     ]
    }
   ],
   "source": [
    "sites = {'Google', 'Taobao', 'Runoob', 'Facebook', 'Zhihu', 'Baidu','Google'}\n",
    "print(sites)   # 输出集合，重复的元素被自动去掉\n",
    "\n",
    "# 成员测试\n",
    "if 'Google' in sites :\n",
    "    print('Google 在集合中')\n",
    "else :\n",
    "    print('Google 不在集合中')\n",
    "\n",
    "# set可以进行集合运算\n",
    "a = set('abracadabra')\n",
    "b = set('alacazam')\n",
    "\n",
    "print(a)\n",
    "print(b)\n",
    "\n",
    "print(a - b)     # a 和 b 的差集\n",
    "print(a | b)     # a 和 b 的并集\n",
    "print(a & b)     # a 和 b 的交集\n",
    "print(a ^ b)     # a 和 b 中不同时存在的元素"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9e70396d",
   "metadata": {},
   "source": [
    "### Dictionary（字典）\n",
    "字典（dictionary）是Python中另一个非常有用的内置数据类型。\n",
    "\n",
    "列表是有序的对象集合，字典是无序的对象集合。两者之间的区别在于：字典当中的元素是通过键来存取的，而不是通过偏移存取。\n",
    "\n",
    "字典是一种映射类型，字典用 { } 标识，它是一个无序的 键(key) : 值(value) 的集合。\n",
    "\n",
    "键(key)必须使用不可变类型。\n",
    "\n",
    "在同一个字典中，键(key)必须是唯一的。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "cd1626fa",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n",
      "2\n",
      "{'name': 'runoob', 'code': 1, 'site': 'www.runoob.com', 'age': 30}\n",
      "dict_keys(['name', 'code', 'site', 'age'])\n",
      "dict_values(['runoob', 1, 'www.runoob.com', 30])\n"
     ]
    }
   ],
   "source": [
    "dict = {}\n",
    "dict['one'] = \"1\"\n",
    "dict[2]     = \"2\"\n",
    "\n",
    "tinydict = {'name': 'runoob','code':1, 'site': 'www.runoob.com'}\n",
    "tinydict['age'] = 30\n",
    "\n",
    "\n",
    "print (dict['one'])       # 输出键为 'one' 的值\n",
    "print (dict[2])           # 输出键为 2 的值\n",
    "print (tinydict)          # 输出完整的字典\n",
    "print (tinydict.keys())   # 输出所有键\n",
    "print (tinydict.values()) # 输出所有值"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "866c81e7",
   "metadata": {},
   "source": [
    "### while 循环\n",
    "Python 中 while 语句的一般形式：\n",
    "```python\n",
    "while 判断条件(condition)：\n",
    "    执行语句(statements)……\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "695a77be",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1 到 800 之和为: 320400\n"
     ]
    }
   ],
   "source": [
    "n = 800\n",
    "\n",
    "sum = 0\n",
    "counter = 1\n",
    "while counter <= n:\n",
    "    sum = sum + counter\n",
    "    counter += 1\n",
    " \n",
    "print(\"1 到 %d 之和为: %d\" % (n,sum))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "30e2ac04",
   "metadata": {},
   "source": [
    "### for 语句\n",
    "Python for 循环可以遍历任何可迭代对象，如一个列表或者一个字符串。\n",
    "\n",
    "for循环的一般格式如下：\n",
    "```python\n",
    "for <variable> in <sequence>:\n",
    "    <statements>\n",
    "else:\n",
    "    <statements>\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "ee648efd",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1 到 200 之和为: 20100\n"
     ]
    }
   ],
   "source": [
    "n = 200\n",
    "sum = 0\n",
    "for i in range(1,n+1): # i 最后一个 i =n\n",
    "    sum+= i\n",
    "\n",
    "print(\"1 到 %d 之和为: %d\" % (n,sum))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "3a2eac1a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "m1 0\n",
      "1900 1\n",
      "m2 2\n",
      "2000 3\n"
     ]
    }
   ],
   "source": [
    "# list 遍历\n",
    "lists = [\"m1\", 1900, \"m2\", 2000]\n",
    "for val in lists:\n",
    "    #print(val)\n",
    "    pass\n",
    "\n",
    "#2.索引遍历 len 函数获取集合数据类型的长度\n",
    "for index in range(0, len(lists)): # 0,1,2,3 index < len(lists) 【start,end ）\n",
    "    print(lists[index], index)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "a6eda476",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "遍历key值:\n",
      "a:1\n",
      "b:2\n",
      "c:3\n",
      "遍历value值:\n",
      "1\n",
      "2\n",
      "3\n",
      "遍历字典健值:\n",
      "a:1\n",
      "b:2\n",
      "c:3\n"
     ]
    }
   ],
   "source": [
    "#字典的遍历\n",
    "#1.遍历key值 在使用上，for key in a和 for key in a.keys():完全等价。\n",
    "a={'a': '1', 'b': '2', 'c': '3'}\n",
    "print(\"遍历key值:\")\n",
    "for key in a.keys():\n",
    "    print(key+':'+a[key])\n",
    "\n",
    "#2.遍历value值\n",
    "print(\"遍历value值:\")\n",
    "for value in a.values():\n",
    "    print(value)\n",
    "\n",
    "#4.遍历字典健值\n",
    "print(\"遍历字典健值:\")\n",
    "for key,value in a.items():\n",
    "    print(key+':'+value)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4a53a394",
   "metadata": {},
   "source": [
    "## 2. Pandas 用法\n",
    "pandas 是基于NumPy 的一种工具，该工具是为解决数据分析任务而创建的。Pandas 纳入了大量库和一些标准的数据模型，提供了高效地操作大型数据集所需的工具。**pandas提供了大量能使我们快速便捷地处理数据的函数和方法**。你很快就会发现，它是使Python成为强大而高效的数据分析环境的重要因素之一。\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c1b70496",
   "metadata": {},
   "source": [
    "### NumPy（Numerical Python的简称）\n",
    "是高性能科学计算和数据分析的基础包。部分功能如下\n",
    "+ ndarray，一个具有矢量算术运算和复杂广播能力的快速且节省空间的多维数组。\n",
    "+ 用于对整组数据进行快速运算的标准数学函数（无需编写循环）。\n",
    "+ 用于读写磁盘数据的工具以及用于操作内存映射文件的工具。\n",
    "+ 线性代数、随机数生成以及傅里叶变换功能。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b190d98b",
   "metadata": {},
   "source": [
    "ndarray是一系列同类型数据的集合，以 0 下标为开始进行集合中元素的索引。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "af84d5c2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([6. , 7.5, 8. , 0. , 1. ])"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "data1=[6,7.5,8,0,1]\n",
    "arr1=np.array(data1)\n",
    "\n",
    "arr1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "0b3e38b3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "x size:  5\n",
      "x dtype:  int64\n"
     ]
    }
   ],
   "source": [
    "x=np.array([1,2,3,4,5])\n",
    "# 数组元素的总个数\n",
    "print (\"x size: \", x.size) \n",
    "\n",
    "# ndarray 对象的元素类型\n",
    "print (\"x dtype: \", x.dtype)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "56195599",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "原数组： [  1.      5.55  123.     -0.567  25.532]\n",
      "绝对值： [  1.      5.55  123.      0.567  25.532]\n",
      "平方： [1.00000000e+00 3.08025000e+01 1.51290000e+04 3.21489000e-01\n",
      " 6.51883024e+02]\n",
      "保留一位小数： [  1.    5.6 123.   -0.6  25.5]\n",
      "向下取整： [  1.   5. 123.  -1.  25.]\n",
      "向上取整： [  1.   6. 123.  -0.  26.]\n"
     ]
    }
   ],
   "source": [
    "a = np.array([1.0,5.55,123,-0.567,25.532])  \n",
    "print  ('原数组：',a)\n",
    "print('绝对值：',np.abs(a))\n",
    "print('平方：',np.square(a))\n",
    "print ('保留一位小数：',np.around(a, decimals =  1))\n",
    "print ('向下取整：',np.floor(a))\n",
    "print ('向上取整：',np.ceil(a))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "722f52ff",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "x     = [1, 2, 3]\n",
      "e^x   = [ 2.71828183  7.3890561  20.08553692]\n",
      "2^x   = [2. 4. 8.]\n",
      "3^x   = [ 3  9 27]\n",
      "ln(x)    = [0.         0.69314718 1.09861229]\n",
      "log2(x)  = [0.        1.        1.5849625]\n",
      "log10(x) = [0.         0.30103    0.47712125]\n"
     ]
    }
   ],
   "source": [
    "#指数运算\n",
    "x = [1, 2, 3]\n",
    "print(\"x     =\", x)\n",
    "print(\"e^x   =\", np.exp(x))\n",
    "print(\"2^x   =\", np.exp2(x))\n",
    "print(\"3^x   =\", np.power(3, x))\n",
    "\n",
    "print(\"ln(x)    =\", np.log(x))\n",
    "print(\"log2(x)  =\", np.log2(x))\n",
    "print(\"log10(x) =\", np.log10(x))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e6a505dd",
   "metadata": {},
   "source": [
    "###  DataFrame\n",
    "数据帧(DataFrame)是二维数据结构，即数据以行和列的表格方式排列。\n",
    "数据帧(DataFrame)的功能特点:\n",
    "- 潜在的列是不同的类型\n",
    "- 大小可变\n",
    "- 标记轴（行和列）\n",
    "- 可以对行和列执行算术运算\n",
    "\n",
    "#### DataFrame创建\n",
    "pandas.DataFrame(data,index,columns,dtype,copy)\n",
    "- data: 数据采用各种形式，如:ndarray,series,map,lists,dict,constant和另一个DataFrame\n",
    "- index:对于行标签，要用于结果帧的索引是可选缺省值,如果没有传递，默认为np.arange(n)\n",
    "- columns:列标签，如果没有传入索引，则默认np.arange(n)\n",
    "- dtype:每列的数据类型\n",
    "- copy:默认值为False，则此命令用于复制数据\n",
    "    \n",
    "DataFrame可以使用各种输入创建，如：列表、字典、ndarrays、另一个DataFrame"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "ca6167c7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   0\n",
       "0  1\n",
       "1  2\n",
       "2  3\n",
       "3  4\n",
       "4  5"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "\n",
    "# 从列表创建DataFrame\n",
    "data = [1,2,3,4,5]\n",
    "df = pd.DataFrame(data)\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "fba549ee",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Name</th>\n",
       "      <th>Age</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Alex</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Bob</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Clarke</td>\n",
       "      <td>13</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     Name  Age\n",
       "0    Alex   10\n",
       "1     Bob   12\n",
       "2  Clarke   13"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = [['Alex',10],['Bob',12],['Clarke',13]]   # 传入多个列表来创建DataFrame\n",
    "df = pd.DataFrame(data,columns=['Name','Age'],dtype = int) #dtype将Age列的类型更改为浮\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "5dcfb243",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Name</th>\n",
       "      <th>Age</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Tom</td>\n",
       "      <td>28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Jack</td>\n",
       "      <td>34</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Steve</td>\n",
       "      <td>29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Ricky</td>\n",
       "      <td>42</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Name  Age\n",
       "0    Tom   28\n",
       "1   Jack   34\n",
       "2  Steve   29\n",
       "3  Ricky   42"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 从ndarrays/Lists的字典来创建DataFrame\n",
    "# 所有的ndarrays必须具有相同的长度。如果传递了索引（index），则索引的长度应等于数组的长度。\n",
    "\n",
    "data = {'Name':['Tom','Jack','Steve','Ricky'],'Age':[28,34,29,42]}\n",
    "df = pd.DataFrame(data)\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "63716993",
   "metadata": {},
   "source": [
    "#### 1.2.2 列、行相关操作\n",
    "##### （1）列选择\n",
    "从数据帧(DataFrame)中选择一列。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "10bb0580",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    1\n",
       "1    2\n",
       "2    5\n",
       "3    4\n",
       "Name: two, dtype: int64"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 从Series的字典来创建DataFrame\n",
    "d = {'one':[1,2,3,5],'two':[1,2,5,4]}\n",
    "df = pd.DataFrame(d)\n",
    "\n",
    "df['two']  # 查询某一列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "3cec688f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>one</th>\n",
       "      <th>two</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   one  two\n",
       "0    1    1\n",
       "1    2    2\n",
       "2    3    3\n",
       "3    5    4"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[['one','two']]  # 查询多列"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "00d1b1d8",
   "metadata": {},
   "source": [
    "##### （2） 列添加\n",
    "向现有数据框添加一个新列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "3b0f5daf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>one</th>\n",
       "      <th>two</th>\n",
       "      <th>three</th>\n",
       "      <th>four</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>20</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>30</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>40</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   one  two  three  four\n",
       "0    1    1     10     2\n",
       "1    2    2     20     4\n",
       "2    3    5     30     8\n",
       "3    5    4     40     9"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 向现有数据框添加一个新列 - \n",
    "df['three'] = [10,20,30,40]\n",
    "df['four'] = df['one'] + df['two']  # 观测结果发现，NAN与其他常数相加的结果还是为NaN\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fa871dce",
   "metadata": {},
   "source": [
    "##### （3）列删除\n",
    "列可以删除或弹出"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "03d1a6c6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "two       5\n",
       "three    30\n",
       "four      8\n",
       "Name: 2, dtype: int64"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 删除one列\n",
    "# del df['one'\n",
    "# df\n",
    "df.loc[2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "da14a4b4",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   a   b     c\n",
      "0  1   2   NaN\n",
      "1  5  10  20.0\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>34.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>20.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   a   b     c\n",
       "0  1   2  34.0\n",
       "1  5  10  20.0"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 修改df 的值\n",
    "data = [{'a':1,'b':2},{'a':5,'b':10,'c':20}]\n",
    "df = pd.DataFrame(data) # NaN附加在缺失的区域\n",
    "print(df)\n",
    "df.loc[0,'c'] = 34\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "05052bc0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>34.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>20.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   a   b     c\n",
       "0  1   2  34.0\n",
       "1  5  10  20.0"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 行切片\n",
    "# 可以使用:运算符选择多行\n",
    "df[:] # [)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "8401acbe",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   a  b\n",
      "0  1  2\n",
      "1  3  4\n",
      "   a  b\n",
      "0  5  6\n",
      "1  7  8\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>7</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   a  b\n",
       "0  1  2\n",
       "1  3  4\n",
       "0  5  6\n",
       "1  7  8"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 附加行\n",
    "# 使用append()函数将新行添加到DataFrame\n",
    "df = pd.DataFrame([[1, 2], [3, 4]], columns = ['a','b'])\n",
    "print(df)\n",
    "\n",
    "df2 = pd.DataFrame([[5, 6],[7, 8]],columns=['a','b'])\n",
    "print(df2)\n",
    "\n",
    "df = df.append(df2)\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "1f5d43e3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>7</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   a  b\n",
       "1  3  4\n",
       "1  7  8"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 删除行\n",
    "# 使用索引标签从DataFrame中删除或删除行。 如果标签重复，则会删除多行。\n",
    "df = df.drop(0) # 删除标签为0的行\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1b91d08d",
   "metadata": {},
   "source": [
    "#### 1.3 基本操作"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "368ce830",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Name</th>\n",
       "      <th>Age</th>\n",
       "      <th>Rating</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Tom</td>\n",
       "      <td>25</td>\n",
       "      <td>4.23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>James</td>\n",
       "      <td>26</td>\n",
       "      <td>3.24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Ricky</td>\n",
       "      <td>25</td>\n",
       "      <td>3.98</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Vin</td>\n",
       "      <td>23</td>\n",
       "      <td>2.56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Steve</td>\n",
       "      <td>30</td>\n",
       "      <td>3.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Minsu</td>\n",
       "      <td>29</td>\n",
       "      <td>4.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Jack</td>\n",
       "      <td>23</td>\n",
       "      <td>3.80</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Name  Age  Rating\n",
       "0    Tom   25    4.23\n",
       "1  James   26    3.24\n",
       "2  Ricky   25    3.98\n",
       "3    Vin   23    2.56\n",
       "4  Steve   30    3.20\n",
       "5  Minsu   29    4.60\n",
       "6   Jack   23    3.80"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 生成样例数据\n",
    "d = {'Name':['Tom','James','Ricky','Vin','Steve','Minsu','Jack'],\n",
    "   'Age':[25,26,25,23,30,29,23],\n",
    "   'Rating':[4.23,3.24,3.98,2.56,3.20,4.6,3.8]}\n",
    "df = pd.DataFrame(d)\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "6ecb1a41",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 Tom 25 4.23\n",
      "1 James 26 3.24\n",
      "2 Ricky 25 3.98\n",
      "3 Vin 23 2.56\n",
      "4 Steve 30 3.2\n",
      "5 Minsu 29 4.6\n",
      "6 Jack 23 3.8\n"
     ]
    }
   ],
   "source": [
    "# 遍历\n",
    "for index, row in df.iterrows():\n",
    "    print(index, row['Name'], row['Age'], row['Rating']) # 输出每行的索引值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "id": "a5ea90f2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Name TomJamesRickyVinSteveMinsuJack\n",
      "Age 181\n",
      "Rating 25.610000000000003\n"
     ]
    }
   ],
   "source": [
    "for index, col in df.iteritems():\n",
    "    print(index, col.sum()) # 输出列名"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "95b94a48",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Name</th>\n",
       "      <td>Tom</td>\n",
       "      <td>James</td>\n",
       "      <td>Ricky</td>\n",
       "      <td>Vin</td>\n",
       "      <td>Steve</td>\n",
       "      <td>Minsu</td>\n",
       "      <td>Jack</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Age</th>\n",
       "      <td>25</td>\n",
       "      <td>26</td>\n",
       "      <td>25</td>\n",
       "      <td>23</td>\n",
       "      <td>30</td>\n",
       "      <td>29</td>\n",
       "      <td>23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Rating</th>\n",
       "      <td>4.23</td>\n",
       "      <td>3.24</td>\n",
       "      <td>3.98</td>\n",
       "      <td>2.56</td>\n",
       "      <td>3.2</td>\n",
       "      <td>4.6</td>\n",
       "      <td>3.8</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           0      1      2     3      4      5     6\n",
       "Name     Tom  James  Ricky   Vin  Steve  Minsu  Jack\n",
       "Age       25     26     25    23     30     29    23\n",
       "Rating  4.23   3.24   3.98  2.56    3.2    4.6   3.8"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# T 转置\n",
    "df.T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "id": "4275de01",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Name       object\n",
       "Age         int64\n",
       "Rating    float64\n",
       "dtype: object"
      ]
     },
     "execution_count": 83,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.dtypes # 返回每列的数据类型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "id": "8e4d3ac6",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "7\n",
      "3\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "(7, 3)"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "print(df.shape[0]) # 行\n",
    "print(df.shape[1]) # 列\n",
    "df.shape # 返回DataFrame的维度元组"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "id": "909168f5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "21"
      ]
     },
     "execution_count": 85,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.size # 返回DataFrame中的元素数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "id": "b72674c0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([['Tom', 25, 4.23],\n",
       "       ['James', 26, 3.24],\n",
       "       ['Ricky', 25, 3.98],\n",
       "       ['Vin', 23, 2.56],\n",
       "       ['Steve', 30, 3.2],\n",
       "       ['Minsu', 29, 4.6],\n",
       "       ['Jack', 23, 3.8]], dtype=object)"
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.values # 将DataFrame中的实际数据作为NDarray返回"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "a17d2009",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Name</th>\n",
       "      <th>Age</th>\n",
       "      <th>Rating</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Tom</td>\n",
       "      <td>25</td>\n",
       "      <td>4.23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>James</td>\n",
       "      <td>26</td>\n",
       "      <td>3.24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Ricky</td>\n",
       "      <td>25</td>\n",
       "      <td>3.98</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Vin</td>\n",
       "      <td>23</td>\n",
       "      <td>2.56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Steve</td>\n",
       "      <td>30</td>\n",
       "      <td>3.20</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Name  Age  Rating\n",
       "0    Tom   25    4.23\n",
       "1  James   26    3.24\n",
       "2  Ricky   25    3.98\n",
       "3    Vin   23    2.56\n",
       "4  Steve   30    3.20"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head() # first 五行\n",
    "# df.tail() # 后五行"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2684a300",
   "metadata": {},
   "source": [
    "#### applay \n",
    "对DataFrame而言，apply是非常重要的数据处理方法，它可以接收各种各样的函数（Python内置的或自定义的），处理方式很灵活，下面通过几个例子来看看apply的具体使用及其原理。\n",
    "\n",
    "在进行具体介绍之前，首先需要介绍一下DataFrame中axis的概念，在DataFrame对象的大多数方法中，都会有axis这个参数，它控制了你指定的操作是沿着0轴还是1轴进行。axis=0代表操作对列columns进行，axis=1代表操作对行row进行，如下图所示。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3668e71a",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'np' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m",
      "\u001B[1;31mNameError\u001B[0m                                 Traceback (most recent call last)",
      "\u001B[1;32m<ipython-input-10-42bb21e402c1>\u001B[0m in \u001B[0;36m<module>\u001B[1;34m\u001B[0m\n\u001B[0;32m      5\u001B[0m \u001B[0mcolor\u001B[0m\u001B[1;33m=\u001B[0m\u001B[1;33m[\u001B[0m\u001B[1;34m\"white\"\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;34m\"black\"\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;34m\"yellow\"\u001B[0m\u001B[1;33m]\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m      6\u001B[0m data=pd.DataFrame({\n\u001B[1;32m----> 7\u001B[1;33m     \u001B[1;34m\"height\"\u001B[0m\u001B[1;33m:\u001B[0m\u001B[0mnp\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mrandom\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mrandint\u001B[0m\u001B[1;33m(\u001B[0m\u001B[1;36m150\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;36m190\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;36m100\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m      8\u001B[0m     \u001B[1;34m\"weight\"\u001B[0m\u001B[1;33m:\u001B[0m\u001B[0mnp\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mrandom\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mrandint\u001B[0m\u001B[1;33m(\u001B[0m\u001B[1;36m40\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;36m90\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;36m100\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m      9\u001B[0m     \u001B[1;34m\"smoker\"\u001B[0m\u001B[1;33m:\u001B[0m\u001B[1;33m[\u001B[0m\u001B[0mboolean\u001B[0m\u001B[1;33m[\u001B[0m\u001B[0mx\u001B[0m\u001B[1;33m]\u001B[0m \u001B[1;32mfor\u001B[0m \u001B[0mx\u001B[0m \u001B[1;32min\u001B[0m \u001B[0mnp\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mrandom\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mrandint\u001B[0m\u001B[1;33m(\u001B[0m\u001B[1;36m0\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;36m2\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;36m100\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m]\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n",
      "\u001B[1;31mNameError\u001B[0m: name 'np' is not defined"
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "# applay 操作\n",
    "boolean=[True,False]\n",
    "gender=[\"男\",\"女\"]\n",
    "color=[\"white\",\"black\",\"yellow\"]\n",
    "data=pd.DataFrame({\n",
    "    \"height\":np.random.randint(150,190,100),\n",
    "    \"weight\":np.random.randint(40,90,100),\n",
    "    \"smoker\":[boolean[x] for x in np.random.randint(0,2,100)],\n",
    "    \"gender\":[gender[x] for x in np.random.randint(0,2,100)],\n",
    "    \"age\":np.random.randint(15,90,100),\n",
    "    \"color\":[color[x] for x in np.random.randint(0,len(color),100) ]\n",
    "})\n",
    "\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "id": "3f288ed6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>height</th>\n",
       "      <th>weight</th>\n",
       "      <th>smoker</th>\n",
       "      <th>gender</th>\n",
       "      <th>age</th>\n",
       "      <th>color</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>163</td>\n",
       "      <td>48</td>\n",
       "      <td>False</td>\n",
       "      <td>女</td>\n",
       "      <td>50</td>\n",
       "      <td>yellow</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>183</td>\n",
       "      <td>69</td>\n",
       "      <td>False</td>\n",
       "      <td>女</td>\n",
       "      <td>50</td>\n",
       "      <td>yellow</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>174</td>\n",
       "      <td>58</td>\n",
       "      <td>False</td>\n",
       "      <td>女</td>\n",
       "      <td>50</td>\n",
       "      <td>white</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>187</td>\n",
       "      <td>83</td>\n",
       "      <td>False</td>\n",
       "      <td>女</td>\n",
       "      <td>50</td>\n",
       "      <td>black</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>160</td>\n",
       "      <td>64</td>\n",
       "      <td>False</td>\n",
       "      <td>女</td>\n",
       "      <td>50</td>\n",
       "      <td>yellow</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>95</th>\n",
       "      <td>184</td>\n",
       "      <td>55</td>\n",
       "      <td>True</td>\n",
       "      <td>女</td>\n",
       "      <td>50</td>\n",
       "      <td>white</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>96</th>\n",
       "      <td>179</td>\n",
       "      <td>64</td>\n",
       "      <td>False</td>\n",
       "      <td>男</td>\n",
       "      <td>50</td>\n",
       "      <td>black</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>97</th>\n",
       "      <td>181</td>\n",
       "      <td>56</td>\n",
       "      <td>True</td>\n",
       "      <td>男</td>\n",
       "      <td>50</td>\n",
       "      <td>white</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>98</th>\n",
       "      <td>183</td>\n",
       "      <td>70</td>\n",
       "      <td>True</td>\n",
       "      <td>男</td>\n",
       "      <td>50</td>\n",
       "      <td>yellow</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99</th>\n",
       "      <td>172</td>\n",
       "      <td>63</td>\n",
       "      <td>True</td>\n",
       "      <td>男</td>\n",
       "      <td>50</td>\n",
       "      <td>yellow</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>100 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    height  weight  smoker gender  age   color\n",
       "0      163      48   False      女   50  yellow\n",
       "1      183      69   False      女   50  yellow\n",
       "2      174      58   False      女   50   white\n",
       "3      187      83   False      女   50   black\n",
       "4      160      64   False      女   50  yellow\n",
       "..     ...     ...     ...    ...  ...     ...\n",
       "95     184      55    True      女   50   white\n",
       "96     179      64   False      男   50   black\n",
       "97     181      56    True      男   50   white\n",
       "98     183      70    True      男   50  yellow\n",
       "99     172      63    True      男   50  yellow\n",
       "\n",
       "[100 rows x 6 columns]"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# data[[\"height\",\"weight\",\"age\"]].apply(np.log, axis=0)\n",
    "data['age'] = data['age'].apply(lambda x: 50 if x > 50 else x)\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "98168cfd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": "      Name  Age  Rating\n0      Tom   25    4.23\n1    James   26    3.24\n2    Ricky   25    3.98\n3      Vin   23    2.56\n4    Steve   30    3.20\n5    Minsu   29    4.60\n6     Jack   23    3.80\n7      Lee   34    3.78\n8    David   40    2.98\n9   Gasper   30    4.80\n10  Betina   51    4.10\n11  Andres   46    3.65",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Name</th>\n      <th>Age</th>\n      <th>Rating</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>Tom</td>\n      <td>25</td>\n      <td>4.23</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>James</td>\n      <td>26</td>\n      <td>3.24</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>Ricky</td>\n      <td>25</td>\n      <td>3.98</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>Vin</td>\n      <td>23</td>\n      <td>2.56</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>Steve</td>\n      <td>30</td>\n      <td>3.20</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>Minsu</td>\n      <td>29</td>\n      <td>4.60</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>Jack</td>\n      <td>23</td>\n      <td>3.80</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>Lee</td>\n      <td>34</td>\n      <td>3.78</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>David</td>\n      <td>40</td>\n      <td>2.98</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>Gasper</td>\n      <td>30</td>\n      <td>4.80</td>\n    </tr>\n    <tr>\n      <th>10</th>\n      <td>Betina</td>\n      <td>51</td>\n      <td>4.10</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>Andres</td>\n      <td>46</td>\n      <td>3.65</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 生成样例数据\n",
    "d = {'Name':['Tom','James','Ricky','Vin','Steve','Minsu','Jack',\n",
    "   'Lee','David','Gasper','Betina','Andres'],\n",
    "   'Age':[25,26,25,23,30,29,23,34,40,30,51,46],\n",
    "   'Rating':[4.23,3.24,3.98,2.56,3.20,4.6,3.8,3.78,2.98,4.80,4.10,3.65]}\n",
    "df = pd.DataFrame(d)\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "8ab04c42",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": "Name      TomJamesRickyVinSteveMinsuJackLeeDavidGasperBe...\nAge                                                     382\nRating                                                44.92\ndtype: object"
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# sum()方法\n",
    "# 返回所请求轴的值得总和。默认情况下，对每一列进行求和\n",
    "df.sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "549508b6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": "0     29.23\n1     29.24\n2     28.98\n3     25.56\n4     33.20\n5     33.60\n6     26.80\n7     37.78\n8     42.98\n9     34.80\n10    55.10\n11    49.65\ndtype: float64"
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.sum(axis=1) # 对每一行进行求和"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "id": "d1776ed2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "--------------\n",
      "Age       31.833333\n",
      "Rating     3.743333\n",
      "dtype: float64\n",
      "--------------\n",
      "Age       9.232682\n",
      "Rating    0.661628\n",
      "dtype: float64\n"
     ]
    }
   ],
   "source": [
    "# mean()\n",
    "# 返回平均值\n",
    "print(\"--------------\")\n",
    "print(df.mean())\n",
    "\n",
    "print(\"--------------\")\n",
    "# std()\n",
    "# 返回数字列的标准偏差\n",
    "print(df.std())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "id": "4a4a7aea",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Age</th>\n",
       "      <th>Rating</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>12.000000</td>\n",
       "      <td>12.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>31.833333</td>\n",
       "      <td>3.743333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>9.232682</td>\n",
       "      <td>0.661628</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>23.000000</td>\n",
       "      <td>2.560000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>25.000000</td>\n",
       "      <td>3.230000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>29.500000</td>\n",
       "      <td>3.790000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>35.500000</td>\n",
       "      <td>4.132500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>51.000000</td>\n",
       "      <td>4.800000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             Age     Rating\n",
       "count  12.000000  12.000000\n",
       "mean   31.833333   3.743333\n",
       "std     9.232682   0.661628\n",
       "min    23.000000   2.560000\n",
       "25%    25.000000   3.230000\n",
       "50%    29.500000   3.790000\n",
       "75%    35.500000   4.132500\n",
       "max    51.000000   4.800000"
      ]
     },
     "execution_count": 102,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 汇总数据\n",
    "# describe()函数是用来计算有关DataFrame列的统计信息的摘要。\n",
    "df.describe() # 默认情况下只统计“数字值”"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9cfd5d9b",
   "metadata": {},
   "source": [
    "### 分组与聚合\n",
    "任何分组(groupby)操作都涉及原始对象的以下操作之一：\n",
    "- 分割对象\n",
    "- 应用一个函数\n",
    "- 结合的结果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "dca359b0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": "      Team  Rank  Year  Points\n0   Riders     1  2014     876\n1   Riders     2  2015     789\n2   Devils     2  2014     863\n3   Devils     3  2015     673\n4    Kings     3  2014     741\n5    Kings     4  2015     812\n6    Kings     1  2016     756\n7    Kings     1  2017     788\n8   Riders     2  2016     694\n9   Royals     4  2014     701\n10  Royals     1  2015     804\n11  Riders     2  2017     690",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Team</th>\n      <th>Rank</th>\n      <th>Year</th>\n      <th>Points</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>Riders</td>\n      <td>1</td>\n      <td>2014</td>\n      <td>876</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>Riders</td>\n      <td>2</td>\n      <td>2015</td>\n      <td>789</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>Devils</td>\n      <td>2</td>\n      <td>2014</td>\n      <td>863</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>Devils</td>\n      <td>3</td>\n      <td>2015</td>\n      <td>673</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>Kings</td>\n      <td>3</td>\n      <td>2014</td>\n      <td>741</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>Kings</td>\n      <td>4</td>\n      <td>2015</td>\n      <td>812</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>Kings</td>\n      <td>1</td>\n      <td>2016</td>\n      <td>756</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>Kings</td>\n      <td>1</td>\n      <td>2017</td>\n      <td>788</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>Riders</td>\n      <td>2</td>\n      <td>2016</td>\n      <td>694</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>Royals</td>\n      <td>4</td>\n      <td>2014</td>\n      <td>701</td>\n    </tr>\n    <tr>\n      <th>10</th>\n      <td>Royals</td>\n      <td>1</td>\n      <td>2015</td>\n      <td>804</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>Riders</td>\n      <td>2</td>\n      <td>2017</td>\n      <td>690</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "\n",
    "# 构建样例数据\n",
    "ipl_data = {'Team': ['Riders', 'Riders', 'Devils', 'Devils', 'Kings',\n",
    "         'Kings', 'Kings', 'Kings', 'Riders', 'Royals', 'Royals', 'Riders'],\n",
    "         'Rank': [1, 2, 2, 3, 3,4 ,1 ,1,2 , 4,1,2],\n",
    "         'Year': [2014,2015,2014,2015,2014,2015,2016,2017,2016,2014,2015,2017],\n",
    "         'Points':[876,789,863,673,741,812,756,788,694,701,804,690]}\n",
    "df = pd.DataFrame(ipl_data)\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "id": "5a9466e5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Team\n",
       "Devils    2\n",
       "Kings     4\n",
       "Riders    4\n",
       "Royals    2\n",
       "dtype: int64"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# groupby 将数据拆分为组\n",
    "# 统计每个分组的数量\n",
    "t = df.groupby('Team').size() # 按Team来分组\n",
    "# print(t.items()) # 转换成tuple list\n",
    "# print([*t.items()]) # 转换成tuple list\n",
    "t"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7cb2da12",
   "metadata": {},
   "source": [
    "zip()是python的一个内置函数，作用是将可迭代的对象作为参数，将对象中对应的元素打包成一个个元组，然后返回由这些元组组成的列表，如果各个迭代器的元素个数不一致，则返回列表长度与最短的对象相同。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "id": "84f01305",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Devils': [2, 3], 'Kings': [4, 5, 6, 7], 'Riders': [0, 1, 8, 11], 'Royals': [9, 10]}"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.groupby('Team').groups"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "id": "4745fa9a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{('Devils', 2014): [2], ('Devils', 2015): [3], ('Kings', 2014): [4], ('Kings', 2015): [5], ('Kings', 2016): [6], ('Kings', 2017): [7], ('Riders', 2014): [0], ('Riders', 2015): [1], ('Riders', 2016): [8], ('Riders', 2017): [11], ('Royals', 2014): [9], ('Royals', 2015): [10]}"
      ]
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 按多列分组\n",
    "df.groupby(['Team','Year']).groups"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "id": "7ee2b8b8",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2014\n",
      "     Team  Rank  Year  Points\n",
      "0  Riders     1  2014     876\n",
      "2  Devils     2  2014     863\n",
      "4   Kings     3  2014     741\n",
      "9  Royals     4  2014     701\n",
      "2015\n",
      "      Team  Rank  Year  Points\n",
      "1   Riders     2  2015     789\n",
      "3   Devils     3  2015     673\n",
      "5    Kings     4  2015     812\n",
      "10  Royals     1  2015     804\n",
      "2016\n",
      "     Team  Rank  Year  Points\n",
      "6   Kings     1  2016     756\n",
      "8  Riders     2  2016     694\n",
      "2017\n",
      "      Team  Rank  Year  Points\n",
      "7    Kings     1  2017     788\n",
      "11  Riders     2  2017     690\n"
     ]
    }
   ],
   "source": [
    "# 对于groupby对象，可以遍历类似itertools.obj的对象\n",
    "grouped = df.groupby('Year')\n",
    "for name,group in grouped:\n",
    "    print(name)\n",
    "    print(group)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "id": "efd4c3b5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Team</th>\n",
       "      <th>Rank</th>\n",
       "      <th>Year</th>\n",
       "      <th>Points</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Riders</td>\n",
       "      <td>1</td>\n",
       "      <td>2014</td>\n",
       "      <td>876</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Devils</td>\n",
       "      <td>2</td>\n",
       "      <td>2014</td>\n",
       "      <td>863</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Kings</td>\n",
       "      <td>3</td>\n",
       "      <td>2014</td>\n",
       "      <td>741</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Royals</td>\n",
       "      <td>4</td>\n",
       "      <td>2014</td>\n",
       "      <td>701</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     Team  Rank  Year  Points\n",
       "0  Riders     1  2014     876\n",
       "2  Devils     2  2014     863\n",
       "4   Kings     3  2014     741\n",
       "9  Royals     4  2014     701"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 选择一个分组\n",
    "# 使用get_group()方法，可以选择一个组。\n",
    "grouped = df.groupby('Year')\n",
    "grouped.get_group(2014)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "id": "9133c22c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Rank</th>\n",
       "      <th>Points</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Year</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2014</th>\n",
       "      <td>2.5</td>\n",
       "      <td>795.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015</th>\n",
       "      <td>2.5</td>\n",
       "      <td>769.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2016</th>\n",
       "      <td>1.5</td>\n",
       "      <td>725.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017</th>\n",
       "      <td>1.5</td>\n",
       "      <td>739.00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      Rank  Points\n",
       "Year              \n",
       "2014   2.5  795.25\n",
       "2015   2.5  769.50\n",
       "2016   1.5  725.00\n",
       "2017   1.5  739.00"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 对分组后的数据进行统计操作\n",
    "df.groupby('Year').mean() # 按Year列分组，获取其他列均值\n",
    "\n",
    "# 按多列分组，并获取其他列的均值\n",
    "# df.groupby(['Year','Team']).mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 115,
   "id": "f28d7584",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Year\n",
       "2014    795.25\n",
       "2015    769.50\n",
       "2016    725.00\n",
       "2017    739.00\n",
       "Name: Points, dtype: float64"
      ]
     },
     "execution_count": 115,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 也可以分组后，选择列进行运算\n",
    "g = df.groupby('Year') # 先按Year列分组\n",
    "g['Points'].mean() # 再对分组总的Points列进行求均值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "id": "9f62be69",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sum</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Year</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2014</th>\n",
       "      <td>3181</td>\n",
       "      <td>795.25</td>\n",
       "      <td>87.439026</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015</th>\n",
       "      <td>3078</td>\n",
       "      <td>769.50</td>\n",
       "      <td>65.035888</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2016</th>\n",
       "      <td>1450</td>\n",
       "      <td>725.00</td>\n",
       "      <td>43.840620</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017</th>\n",
       "      <td>1478</td>\n",
       "      <td>739.00</td>\n",
       "      <td>69.296465</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       sum    mean        std\n",
       "Year                         \n",
       "2014  3181  795.25  87.439026\n",
       "2015  3078  769.50  65.035888\n",
       "2016  1450  725.00  43.840620\n",
       "2017  1478  739.00  69.296465"
      ]
     },
     "execution_count": 119,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 一次应用多个聚合函数\n",
    "grouped = df.groupby('Year')\n",
    "grouped['Points'].agg([np.sum,np.mean,np.std]) # g.agg(np.mean)\n",
    "# grouped['Points'].agg(np.sum)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 122,
   "id": "2a727bd5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2014\n",
      "     Team  Rank  Year  Points\n",
      "0  Riders     1  2014     876\n",
      "2  Devils     2  2014     863\n",
      "4   Kings     3  2014     741\n",
      "9  Royals     4  2014     701\n",
      "2015\n",
      "      Team  Rank  Year  Points\n",
      "1   Riders     2  2015     789\n",
      "3   Devils     3  2015     673\n",
      "5    Kings     4  2015     812\n",
      "10  Royals     1  2015     804\n",
      "2016\n",
      "     Team  Rank  Year  Points\n",
      "6   Kings     1  2016     756\n",
      "8  Riders     2  2016     694\n",
      "2017\n",
      "      Team  Rank  Year  Points\n",
      "7    Kings     1  2017     788\n",
      "11  Riders     2  2017     690\n"
     ]
    }
   ],
   "source": [
    "# 查看一下分组的结果\n",
    "for k,v in g:\n",
    "    print(k)\n",
    "    print(v)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "b9cbaf95",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Team</th>\n",
       "      <th>Rank</th>\n",
       "      <th>Year</th>\n",
       "      <th>Points</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Riders</td>\n",
       "      <td>1</td>\n",
       "      <td>2014</td>\n",
       "      <td>876</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Riders</td>\n",
       "      <td>2</td>\n",
       "      <td>2015</td>\n",
       "      <td>789</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Kings</td>\n",
       "      <td>3</td>\n",
       "      <td>2014</td>\n",
       "      <td>741</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Kings</td>\n",
       "      <td>4</td>\n",
       "      <td>2015</td>\n",
       "      <td>812</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Kings</td>\n",
       "      <td>1</td>\n",
       "      <td>2016</td>\n",
       "      <td>756</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Kings</td>\n",
       "      <td>1</td>\n",
       "      <td>2017</td>\n",
       "      <td>788</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Riders</td>\n",
       "      <td>2</td>\n",
       "      <td>2016</td>\n",
       "      <td>694</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Riders</td>\n",
       "      <td>2</td>\n",
       "      <td>2017</td>\n",
       "      <td>690</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      Team  Rank  Year  Points\n",
       "0   Riders     1  2014     876\n",
       "1   Riders     2  2015     789\n",
       "4    Kings     3  2014     741\n",
       "5    Kings     4  2015     812\n",
       "6    Kings     1  2016     756\n",
       "7    Kings     1  2017     788\n",
       "8   Riders     2  2016     694\n",
       "11  Riders     2  2017     690"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# filter()函数用于过滤数据\n",
    "# 根据定义的标准过滤数据,并返回数据的子集\n",
    "f = df.groupby('Team').filter(lambda x: len(x)>3) #筛选出记录数大于3的组\n",
    "f"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 123,
   "id": "5564b294",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Team</th>\n",
       "      <th>Rank</th>\n",
       "      <th>Year</th>\n",
       "      <th>Points</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Riders</td>\n",
       "      <td>1</td>\n",
       "      <td>2014</td>\n",
       "      <td>876</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Riders</td>\n",
       "      <td>2</td>\n",
       "      <td>2015</td>\n",
       "      <td>789</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Devils</td>\n",
       "      <td>2</td>\n",
       "      <td>2014</td>\n",
       "      <td>863</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Devils</td>\n",
       "      <td>3</td>\n",
       "      <td>2015</td>\n",
       "      <td>673</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Riders</td>\n",
       "      <td>2</td>\n",
       "      <td>2016</td>\n",
       "      <td>694</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Riders</td>\n",
       "      <td>2</td>\n",
       "      <td>2017</td>\n",
       "      <td>690</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      Team  Rank  Year  Points\n",
       "0   Riders     1  2014     876\n",
       "1   Riders     2  2015     789\n",
       "2   Devils     2  2014     863\n",
       "3   Devils     3  2015     673\n",
       "8   Riders     2  2016     694\n",
       "11  Riders     2  2017     690"
      ]
     },
     "execution_count": 123,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.groupby('Team').filter(lambda x: np.max(x['Rank'])<=3)  # 筛选出组中最大排名不超过3的组"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "08a8e9ba",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": "   col1  col2\n0     2     1\n3     1     4\n1     1     3\n2     1     2",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>col1</th>\n      <th>col2</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>2</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>1</td>\n      <td>4</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>1</td>\n      <td>3</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>1</td>\n      <td>2</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 排序\n",
    "# sort_values()\n",
    "unsorted_df = pd.DataFrame({'col1':[2,1,1,1],'col2':[1,3,2,4]})\n",
    "# ascending=False 降序\n",
    "# by = ['col1','col2'] 多列进行排序\n",
    "sorted_df = unsorted_df.sort_values(by=['col1','col2'] , ascending=False) # 根据列col1的值来排序\n",
    "sorted_df"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3d663001",
   "metadata": {},
   "source": [
    "## 数据可视化\n",
    "Matplotlib 是 Python 的绘图库。 它可与 NumPy 一起使用，提供了一种有效的 MatLab 开源替代方案。\n",
    "就像我们使用np、pd作为NumPy和Pandas的简写，Matplotlib也有一些约定成俗的缩写\n",
    "```shell\n",
    "sudo yum install python-matplotlib\n",
    "```\n",
    "\n",
    "实例网站：https://matplotlib.org/stable/gallery/index.html"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "30707850",
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib as mpl\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "36d5c693",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 设置Matplotlib图形的全局默认大小\n",
    "plt.rc('figure', figsize=(10, 5))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "31cf1699",
   "metadata": {},
   "source": [
    "为了在图表中能够显示中文和负号等，需要下面一段设置"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5a263af8",
   "metadata": {},
   "source": [
    "### 基本图形\n",
    "figure 画布，\n",
    "Axes是从作为画图者的我们的角度来定义的，我们要画的点、线等都在Axes这个层面来进行。画图用的坐标系统自然也是在Axes中来设置的。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "id": "dae1258c",
   "metadata": {},
   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gevjHNejwOxw/VOArhHPvS7cjouAa+P9Xobjo4DHCjwvZtuM4JvhWiCb4Pzr9cBNwE3hfAOeDmNOB1Ljsb2iiOt5YGvE/jUjnN4+3E6zwvd5ZAzexwPFdkvEPjaNiGRV2D4Qr7jCNtcQXEQS+byYbjOC03YOpEW8X4PisZ+pxISISJIrL30EIiJyiJQIRESSnBKBiEiSUyIQEUlySgQiIklOiUCSmpnVM7NfhMMtzGxsjNbTx8z+Xsz8xmb2fizWLXIgSgSS7OoRVKbF3de4+0UxWs9dwJ+LmunuG4G1ZnZ8jNYvUiQlAkl2jwEdwvryb+bXqLfgfgxvm9lHYQ36Wyy4d8R/woJ2+fXpO5jZ+2ERsi/MrGvBFZhZbaC3u88Kx0+OqHf/n3A+BLV2Lo/LqxaJoEQgyW4EsNjdjwTuKDCvJ3Ah0A94GNjt7n2Ab4CrwjZjgP9z96OA24G/ApjZ+Wb2QNgmFYi8CcrtwC/DdZ4I7AmnzwjHReJK1UdFijbFg7rwO81sO0FFVgh+2t87rBJ5HPBmcGsLIKhZhbtPAPLvkNYc2Bix3K+AP5jZq8B4d18VTt8AtIjVixEpihKBSNGyIobzIsbzCP53KgDbwm/2xdlDUOsKAHd/zMwmEdSR+crMznL3eWGbPUUsQyRmdGpIkt1OgtsCHjQPasUvNbOL4b/3kz2ikKZzgY75I2bWwd3T3X008B1BJVWAzux/CkkkLpQIJKl5UJ//q7CT+IlDWMTlwPVmll+R8gLYv48g/LZfN6JT+DfhTdHTCCpg5t817BRg0qG/GpFDo+qjInFgZrcCO939+WLaTCW4eczWotqIxIKOCETi4xn273PYj5k1Bv6gJCCJoCMCEZEkpyMCEZEkp0QgIpLklAhERJKcEoGISJJTIhARSXL/D4bRyllnVbgoAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 线图\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "\n",
    "# Data for plotting\n",
    "t = np.arange(0.0, 2.0, 0.01)\n",
    "s = 3 + 0.5*t\n",
    "\n",
    "# fig 画布\n",
    "# axes \n",
    "fig, ax = plt.subplots()\n",
    "ax.plot(t, s)\n",
    "\n",
    "ax.set(xlabel='time:(s)', ylabel='voltage (mV)',\n",
    "       title='About as simple as it gets, folks')\n",
    "# ax.grid()\n",
    "\n",
    "# fig.savefig(\"test.png\")\n",
    "plt.show()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "aed214b3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAV0AAADnCAYAAAC9roUQAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Z1A+gAAAACXBIWXMAAAsTAAALEwEAmpwYAAA8fklEQVR4nO3deXxbxbn4/88cLZZlWbJjO/vibDhO4gSzhUCgLKVQoKZ0AUqB0OUC5Xa97W253RDt5f56v1za0kIIO2lZy5qwJ5CwBeIEyOIkjnH2PfEq2ZZtSefM74+jhGBbjp3IOpI8b15+2ZyRznnkyI/Hc56ZEVJKFEVRlOTQrA5AURRlMFFJV1EUJYlU0lUURUkilXQVRVGSSCVdRVGUJFJJV1EUJYlU0lUURUkilXQVJcGEEK1Wx6CkLpV0FUVRkkglXUVJAiHEiUKIFUKIdUKIF4QQ+bHjp8aOrRFC3CGEWB87Pk0IsTJ2fJ0QYrK1r0BJFJV0FSU5/gH8Sko5A6gCbo0dfwS4UUp5IqAf8fibgLtix08BdicvVGUgqaSrKANMCOED8qSU78QOLQDOFkLkAblSyg9jx5844mkfAr8WQvwKGCelbE9awMqAUklXUVKQlPIJoAJoB14VQpxncUhKgqikm+KEEHpsXO/QR7HVMSn9I6UMAE1CiLNih64F3pFSNgMtQohZseNXHXqOEGICsFVK+TdgITAjiSErA8hudQDKUbXHx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ZoWVqe0ETCVsOTuowYHUaz3q436216k96qN0cD0eZIY6S5Y09Hg9FuODCTrB2QsZhrMbdQ2hRcHaxPVCzK4KSSrtJNRYnDCZyAWfFwOvDuoprIgmM5VywJF2L2ok8ApmOO/UrMsdAw0B776L7lvIZwFjm9tmxblubSnFqW5tSytCzhFE7NqTmFQzg1h5YFCBmVYSNqRGRURg79Z0QM83OnEQ7Xh4PRpuihhO8EXJjj2lmxeATmVOqNwKeYvdqDathASSSVdJVexcZ+I7GlJRPCW+7NwVwXeCjmjhgjYx95mMkPzARoYPY09R4+Dh0HM3nbevl8qGb4UGLVMIc9DmBOHtkF7AT2BFcHQ4l6nYrSE5V0lZQRuyGXj3ljLx8zKXsw1w52Y/ZKszF7qG7MZKph9pAPTULoxCyFO/S5AzO51mHeKGwGmtUeY4pVVNJVFEVJIrVdj6IoShKppKsoipJEKukqiqIkkUq6iqIoSaSSrqIoShKppKsoipJEKukqiqIkkUq6iqIoSaSSrqIoShKppKsoipJEKukqiqIkkUq6iqIoSaSSrqIoShKppKsoipJEKukqiqIkkUq6iqIoSfT/A7ov0D6tl/HuAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 饼图\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "# 饼状图，其中的切片将按逆时针方向排列和绘制\n",
    "labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'\n",
    "sizes = [15, 30, 45, 10]\n",
    "explode = (0, 0.1, 0, 0)  # only \"explode\" the 2nd slice (i.e. 'Hogs')\n",
    "\n",
    "fig1, ax1 = plt.subplots()\n",
    "ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.1f%%',\n",
    "        shadow=True, startangle=90)\n",
    "\n",
    "ax1.axis('equal')  # 相同的长宽比确保饼图被绘制成一个圆\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 135,
   "id": "0e11b560",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAEYCAYAAAAJeGK1AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAeAElEQVR4nO3deXxV1b338c+PkBCQqTIYSkBAURDFKmjB4QGxSAXaOj8KpeCDTMWqKFrwch9xeFVbuaKRCiKtvVVoC17qiEWt1dLWtgbuVUEGWwptLMhUIAJChN/9Y29oGkMGYJ+9knzfr1deOTnn7LN+WSfsL2vvddY2d0dERCQ09dIuQEREpDwKKBERCZICSkREgqSAEhGRICmgREQkSAooEREJUv20CxAJgZnVA04GDrj7n9KuR0Q0gpIAmFlDM5tlZg+b2TNmdkMKZVwFvA98PYW2M87MjjezBWaW6Achzay/me0xs6lJtiO1kwJKQnALsNfdbwGuAY7PdAHuPh8oynS7aXH3bcBLGWjnVeCjpNuR2kkBJSHIA640s0sAB6anXM8hZtbDzC4yswvjUUd/M+tXyTa51Xj9RmbW3MxyS91uFD/Wxsx+VM16q9x2mq8pUhU6ByUhmAMMBxYD7wBjgd+b2QXAKKA5sM/drzazG4GvAGuAzsBIoEm8TTNgMDAAOA4YTzQq+jzRobvRwFlAFvBKPGoq62Iz+wJwNnBT3M7vgZ+6+zAz6wUsLL2BmeUBjxONFM4BiszsP4A7gL8ClwInxTWWrb098AuiUH4BmA8sMbNbgf8CTjGz6cBQYAlwrbuXlGr7JGAWsC6uudDMbgGujPv03fj3/r67TzKz5nF/7wM6lvdmmNlx8XM+BnoAn5rZl+J2lgKXx79Lvfh3+DT+vbKAS9z9z2Z2FdHIeBXQutRrXw5cFre/A/j3eNv/B+wHPnb3/1teXVL3aAQlqXP394CuRDvpk4FXzKwZ8Cwwm2iH9l0z6wYUAI+4+7eIDgV+j2jHeDOwh2in/hHwM8CIdp6tgVOAf4vvux/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os+j7gZKUiuyCnSI77NuBv588E0FcPf1wHR3/zWwI7XKwlVRny2I78onGhlIxf21Ol6rcgCwLqX6QnTYPjOz/kAR8Oe0igvQYfsLcOBtYC3RCCtYGkF9Vi6lgtvMTgVuAdqb2YS0igpcZX2WQ7QG2O3lbl33VNZfq4EpwGtm1sLdd6VSZVgO12enAKcBfwDOBnab2WJ3fyuNIgNy2L8x4E6gA1F//c7MnnT34hRqrJRGUJ81B+hiZmcDuPtq4B9Eh6rWpFpZuA7bZ/HjLYAfAoPN7Mx0SgxKRf21wd3/BqwgOlewN7Uqw3K4Pqvn7m3c/TLgdeCnCieg4v3YOx5ZCqwH9qRYZ4U0girD3Z83syuBu83sd8B2oCfwrJm1AfoQvfFd3H1ViqUGo6I+Izope0mpp7fPeIGBqaS/njaz38RP/aq7f5pOlWGppM+kjEr2Y48DfyE6LHpDyH9jWklCRESCpEN8IiISJAWUiIgESQElIiJBUkCJiEiQFFAiIhIkBZSIiARJASUiIkH6X0cjxgCHUgZnAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 柱状图\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "\n",
    "\n",
    "# plt.rcParams['font.sans-serif'] = 'simhei'\n",
    "# plt.rcParams['axes.unicode_minus']=False\n",
    "\n",
    "labels = ['G1', 'G2', 'G3', 'G4', 'G5']\n",
    "men_means = [20, 34, 30, 35, 27]\n",
    "women_means = [25, 32, 34, 20, 25]\n",
    "\n",
    "x = np.arange(len(labels))  # the label locations\n",
    "width = 0.35  # the width of the bars 宽度\n",
    "\n",
    "fig, ax = plt.subplots()\n",
    "# 设置两个柱状图的数据及宽度与标签\n",
    "rects1 = ax.bar(x - width/2, men_means, width, label='Men')\n",
    "rects2 = ax.bar(x + width/2, women_means, width, label='Women')\n",
    "\n",
    "ax.set_ylabel('Scores')\n",
    "ax.set_title('Scores by group and gender')\n",
    "\n",
    "# x 设置\n",
    "ax.set_xticks(x)\n",
    "ax.set_xticklabels(labels)\n",
    "ax.legend()\n",
    "\n",
    "# y设置\n",
    "ax.bar_label(rects1, padding=4)\n",
    "ax.bar_label(rects2, padding=4)\n",
    "\n",
    "# ax.invert_yaxis()  # labels read top-to-bottom\n",
    "fig.tight_layout()# 自动紧凑布局\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "id": "9e54b42c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAW0AAAD4CAYAAAAn3bdmAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Z1A+gAAAACXBIWXMAAAsTAAALEwEAmpwYAAARNklEQVR4nO3df4xV5Z3H8fdXsLqICqwMTIAF3UHDj+gIREhqaS07rkUXFklIjbuMkQS32y1t3P6g22St/1E3NropacXadnC7tpKiGAO2iLK4TdAdflWEukO7UJiMA/KjLYt2KT77x1zIgMwP4N458wzvVzLhzjNnnvuZ5575cO65c3IjpYQkKQ+XFB1AktR9lrYkZcTSlqSMWNqSlBFLW5Iy0r8Sk15zzTVpzJgxlZhakvqkTZs2vZtSGtrVdhUp7TFjxtDY2FiJqSWpT4qIPd3ZztMjkpQRS1uSMmJpS1JGLG1JyoilLUkZsbQlKSOWtiRlxNKWpIxU5OKaPQeO8cCyTZWYWurUEwsnFx1BqiiPtCUpI5a2JGXE0pakjFjakpQRS1uSMmJpS1JGLG1JyoilLUkZsbQlKSOWtiRlxNKWpIxY2pKUEUtbkjJiaUtSRixtScqIpS1JGbG01efcf//9VFVVMXHixFNjhw4doq6ujrFjx1JXV8fhw4cBSCmxaNEiampquPHGG9m8eXNRsaVu6XZpR0S/iNgSES9WMpB0oe677z5eeuml08aWLFnCjBkzaGpqYsaMGSxZsgSANWv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8oPWX5XlGnH0oS8LOI2BQRC0tjw1JKLaXb7wDDiol2mk9z+i9Mb1k/6Hi9ets+eT9tR14nXRsRWyLiPyLiY0WF4uyPZW9bu48BrSmlpnZjha3fGX3So/vfRfFCZEQMBH4CfCGl9Dvg28CfA7VAC21Pu4pya0ppEvAp4LMRMb39F1Pb86xC/y4zIj4CzAJWlIZ60/qdpjes19lExNeAPwI/LA21AH+WUroZeBD494i4qoBovfaxPMM9nH7QUNj6naVPTumJ/a+cpd0MjGr3+cjSWKEi4lLaFviHKaWVACml1pTSiZTSB8CTVPhpX2dSSs2lf/cDz5WytJ58GlX6d39R+Uo+BWxOKbVC71q/ko7Wq1fskxFxH3AXcG/pl5rSaYeDpdubaDtnfH1PZ+vksewVawcQEf2Bu4Efnxwrav3O1if08P5XztL+L2BsRFxbOjL7NPBCGec/Z6XzYE8BO1NK32w33v680hxg+5nf2xMi4oqIuPLkbdpetNpO27rVlzarB1YVka+d045yesv6tdPRer0AzC+9ij8N+G27p7E9IiLuAL4MzEopHWs3PjQi+pVuXweMBX7dk9lK993RY/kC8OmIuCwiri3le6On85X8BfDLlNK+kwNFrF9HfUJP739lfnV1Jm2vqP4K+Fo55z7PPLfS9lTlF8DW0sdM4GngzdL4C0B1Qfmuo+0V+m3AWyfXDPhTYB3QBLwMDClwDa8ADgJXtxsrbP1o+8+jBThO2znCBR2tF22v2i8t7Y9vAlMKyLaLtvOaJ/e/75S2nVt6zLcCm4G/KmjtOnwsga+V1u5t4FNF5CuN/wD4uzO2LWL9OuqTHt3/vIxdkjJyUbwQKUl9haUtSRmxtCUpI5a2JGXE0pakjFjakpQRS1uSMvL/Q3Nl6RHEnzAAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 横向柱状图\n",
    "import matplotlib.pyplot as plt\n",
    "from matplotlib.font_manager import FontProperties\n",
    "\n",
    "#数据\n",
    "name=['1','2','3','4']\n",
    "colleges=[91,34,200,100]\n",
    "\n",
    "#图像绘制\n",
    "fig,ax=plt.subplots()\n",
    "b=ax.barh(range(len(name)),colleges,color='#6699CC')\n",
    "\n",
    "#添加数据标签\n",
    "for rect in b:\n",
    "    w=rect.get_width()\n",
    "    ax.text(w,rect.get_y()+rect.get_height()/2,'%d'%int(w),ha='left',va='center')\n",
    "\n",
    "#设置Y轴刻度线标签\n",
    "ax.set_yticks(range(len(name)))\n",
    "#font=FontProperties(fname=r'/Library/Fonts/Songti.ttc')\n",
    "ax.set_yticklabels(name)\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 126,
   "id": "af9f98a2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAW0AAAD3CAYAAADWiwWzAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAQrUlEQVR4nO3df4hl9XnH8ffT7Qqj2TAVp5qdZd22BqVmC0sHA1HrHyYsUiTLIIW6FQyRjaYbwT+E+Ecx0JIxbAlWowtrbChJTP9KNo1NIqigBIQ4usEQsipIN3HilrF0Sexu2dU+/ePe2Z0dx7k/5p4553vu+wWDd+78eg7X+czZ5zzn+43MRJJUht+ruwBJUv8MbUkqiKEtSQUxtCWpIIa2JBXk96v+AZdccknu2LGj6h8jSa3y0ksvvZ2ZUyufrzy0d+zYwfz8fNU/RpJaJSKOrfa87RFJKoihLUkFMbQlqSCGtiQVxNCWpIJUPj0iSU11+MgCB556ld+cOMXWyQnu3X0le3ZN113WmgxtSWPp8JEF7vvuzzl15j0AFk6c4r7v/hyg0cFte0TSWDrw1KtnA3vJqTPvceCpV2uqqD+GtqSx9JsTpwZ6vikMbUljaevkxEDPN0XP0I6ITRHxWES8FREHI+LqiHg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5lvSLixoh4vvv46oh4KCIORMR1ddc2jBXHc3v3dXoX2FlvZYOLiC0R8c2IeDUinoyIyyPi0Yj4UkTcUnd9w1jlmHZ3X6P/A/6y7voG1T0heCwi3oqIg4P+DjV1Pe3PApOZ+UhEPB8Rn8zMp+suap1uAZ6i8z9asSLiKmATsL371OPAfXTuen02Iv4kM9/7oK9vmlWOZxHY0n18upai1ud64C7gDHCczlTCvwLfBo5HxDOZ+d811jeMlcf0DHApcLL7XGkuA+4B/hn4HAP+DjXyTBv4FJ0Xh+5/d9dYy6g8DPwaOBgRm3p9clNl5lHgNeicAQEfp/MaHQcuB66qr7rBLT+erg8DrwO/BD5dS1HrkJk/zMx3gIuBV4AZ4Hhmnqbzr4dP1FnfMFY5ppeBF4E36IReUTJzAfhD4B+AIwz4O9TU0I7u25Km1jmIK7pv19KOP0Jw7jVq02v1/cz8CLAfeKTuYoYREZPAXuBmWvK7tOKYfgrsAG4CDnRPHkpzGrgVuL/7ft+vUVNfwKeBbd3Hl3bfL1pmnszM/wJ+xrl/RRQtM39L54xnG53X6U3gaK1FrVNmnuw+fBZ4q85ahhERF9EJsweBC7tPb4uIC4DNwAs1lTa0VY5pb3a8RKelcKrG8gYWER/KzDcz8z+BX9H5F1Dfv0NN7Wk/BnwsIvYDP8nMH9Vd0HpExB3ANcCTwA8y8+WaSxpa95d/FpiMiBuAzwBfAH4H3JaZRfUYVzmee+hce3iPzplQae4Gvgw80X3/djo94a3AnZlZ4up4K4/pjYi4hE7A3ZGZ79ZW2XD2R8RHgeeAr9H5Q9r375B3REpSQZraHpEkrcLQlqSCGNqSVBBDW5IKYmhLUkEMbUkqiKEtSQX5f+GdKEBByVwvAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 散点图\n",
    "from matplotlib import pyplot as plt \n",
    "fig, ax = plt.subplots()\n",
    "\n",
    "# 不指定哪个subplot，则matplotlib就会在最后一个用过的subplot（如果没有则创建一个）上进行绘制\n",
    "# 折线图plt.plot(x, y,  ls, lw, label)展现变量的趋势变化。\n",
    "\n",
    "import numpy as np\n",
    "# subplot对象绘制\n",
    "ax.scatter(np.arange(30), np.arange(30) + 3 * np.random.randn(30))\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "id": "30ab927c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAV0AAAD4CAYAAABPLjVeAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Z1A+gAAAACXBIWXMAAAsTAAALEwEAmpwYAABU8UlEQVR4nO39d4xkW57Yd37P9eFtelNZ3j5fz7/u6e7pnulpDmcGkiDNUCIgiFQDC3JXXBmIMhgJXCzA3ZWIJbDDxbaGI4kyHJESoW1ym9MczvR0T79+rp6tV1WvvElvI8NHXHf2j8iqyqz0lZGZkVnnAwSQGebGicyIX5x7zO8npJQoiqIoe0Pb7wYoiqI8S1TQVRRF2UMq6CqKouwhFXQVRVH2kAq6iqIoe8jY7SfI5/NyZGRkt59GUZRD4OOPP56TUnbt5Bjf/ZXX5Nx8cWvP98mNH0spv7uT59uuXQ+6IyMjXLp0abefRlGUQ0AIcX+nx5ibL/Lhu39vS/fVI9/O7/T5tmvXg66iKMpe6+TdByroKopyyEg6OeyqoKsoyqHS2SFXBV1FUQ4h2cFhVwVdRVEOnc4NuSroKopyCKmernKgSSm5OTHH+GyRvmySU4NdaJrY72YpytokdHLyRLUjTdnUVKHMJzfGaXo+n94eZ3Rmcb+bpCgHlgq6yqYaTQ9dg4htYhoaNdfd7yYpyrrkNi77QQ0vKJvqzSaJOhYzhQq2aTDYld7vJinKhsL9bsAGVNBVNhWxTb7z8inK9SYxx8ax1NtG6WwdPKSrgq6yNZZpkDPV20VRdkp9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Hqee9A9iJiUhRC9wCUgCIa1Z83MH8TRQCPE94P8J6MAfSCn/r/vboqcjhPiHwDdopRicBv4LKeXf39dGPQUhxDvAnwOXab23AP5TKeWP9q9VB9szHXQVRVH22jM3vKAoirKfVNBVFEXZQyroKoqi7CEVdBVFUfaQCrqKoih7SAVdRVGUPaSCrqIoyh76/wMPD5+QO2bexAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 带颜色的散点图\n",
    "rng = np.random.RandomState(0)\n",
    "x = rng.randn(100)\n",
    "y = rng.randn(100)\n",
    "colors = rng.rand(100)\n",
    "\n",
    "sizes = 100 * rng.rand(100)\n",
    "\n",
    "plt.scatter(x, y, c=colors, s=sizes, alpha=0.3,\n",
    "            cmap='viridis') # viridis 翠绿色主题\n",
    "plt.colorbar();  # show color scale"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "234018dc",
   "metadata": {},
   "source": [
    "### 多图绘制"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f276c21a",
   "metadata": {},
   "source": [
    "### 增加子图，图中图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 127,
   "id": "ab9ce234",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAD3CAYAAAAALt/WAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAlCUlEQVR4nO3deZgU1dn+8e8zMOxbWERlVRAFxRVR0YgaFRU1KsQFUHhNYtxeY/KiRiLiAu4monH5oVEQUATGuIKKQXGNIO4KKOKCIIILsi/DnN8fpyfd1TPDbN1dXd3357q4mHq6uudpmLmn5lSdU+acQ0REoqsg7AZERKR2FOQiIhGnIBcRiT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Fn8P5GWQx65QOQH4hZkNAp7HH3GMwZ8E+b2Z9Y7tfhiwD9DOzA4FOuBXcMwVq/Dv6UD80ThmdjjQE9gt9vEviPB7NrNfAqfEhgpuA27H/5AqHToYCMwHZgPf4U/+tQV2BA6IDcWAH1ttBERuCYrYv8GvzewEAOfcKvwR6jv4I3TM7ED8MNtdsZOg3fBf/51i+/UGHoraFT5mVtfM/gicambdYid7d8S/v374H1474n8jn2Zm/8b/QD8A/32/F7ATWfybuGZ2VsDM6jjntsWOQOrgj1wprTnntoXbYe2YWRP8MFG72HsqwH89lL7nuvj3XOKcK8mF95wKZnahc+6esPtIJTMz55wzs4LYbx7lPVb6/VBmHwlfqpaxzTmloRX7e1t5j0WVmT0FLAQGJbzP/35z5uJ7rq3YCcHLgEvC7iXVXOxorryATniszNeJZA8dkYuIRFxejpGLiOQSBbmISMQpyEVEIk5BLiIScQpyEZGI+/8kEKFcpnl0egAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#给柱状图增加折线\n",
    "income = [100, 400, 900, 160, 250]\n",
    "name = ['Tom','Jim','Mary','Nick','Alen']\n",
    "plt.bar(name,income,color='g')\n",
    "plt.plot(name,income,linewidth=4,color='r')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "828eb4e5",
   "metadata": {},
   "source": [
    "##  Pycharts\n",
    "Echarts 是一个由百度开源的数据可视化，凭借着良好的交互性，精巧的图表设计，得到了众多开发者的认可。而 Python 是一门富有表达力的语言，很适合用于数据处理。当数据分析遇上数据可视化时，pyecharts 诞生了。\n",
    "\n",
    "官网：https://pyecharts.org/#/zh-cn/intro\n",
    "```python\n",
    "import pyecharts\n",
    "print(pyecharts.__version__)\n",
    "```\n",
    "\n",
    "> pip(3) install pyecharts\n",
    "\n",
    "栗子:\"https://gallery.pyecharts.org/#/README\""
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2fb90235",
   "metadata": {},
   "source": [
    "### 柱状图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "b4677b6f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"25a219fdab944c42a2859090047ad97a\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'macarons'], function(echarts) {\n",
       "                var chart_25a219fdab944c42a2859090047ad97a = echarts.init(\n",
       "                    document.getElementById('25a219fdab944c42a2859090047ad97a'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_25a219fdab944c42a2859090047ad97a = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5546\\u5bb6A\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                68,\n",
       "                126,\n",
       "                78,\n",
       "                87,\n",
       "                62,\n",
       "                67,\n",
       "                76\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5546\\u5bb6B\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                93,\n",
       "                93,\n",
       "                115,\n",
       "                103,\n",
       "                54,\n",
       "                149,\n",
       "                67\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5546\\u5bb6A\",\n",
       "                \"\\u5546\\u5bb6B\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5546\\u5bb6A\": true,\n",
       "                \"\\u5546\\u5bb6B\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u6cb3\\u9a6c\",\n",
       "                \"\\u87d2\\u86c7\",\n",
       "                \"\\u8001\\u864e\",\n",
       "                \"\\u5927\\u8c61\",\n",
       "                \"\\u5154\\u5b50\",\n",
       "                \"\\u718a\\u732b\",\n",
       "                \"\\u72ee\\u5b50\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u67f1\\u72b6\\u56fe\\u5b9e\\u4f8b\",\n",
       "            \"subtext\": \"\\u6211\\u662f\\u526f\\u6807\\u9898\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"brush\": {\n",
       "        \"toolbox\": [\n",
       "            \"rect\",\n",
       "            \"polygon\",\n",
       "            \"keep\",\n",
       "            \"clear\"\n",
       "        ],\n",
       "        \"brushType\": \"rect\",\n",
       "        \"brushMode\": \"single\",\n",
       "        \"transformable\": true,\n",
       "        \"brushStyle\": {\n",
       "            \"borderWidth\": 1,\n",
       "            \"color\": \"rgba(120,140,180,0.3)\",\n",
       "            \"borderColor\": \"rgba(120,140,180,0.8)\"\n",
       "        },\n",
       "        \"throttleType\": \"fixRate\",\n",
       "        \"throttleDelay\": 0,\n",
       "        \"removeOnClick\": true\n",
       "    }\n",
       "};\n",
       "                chart_25a219fdab944c42a2859090047ad97a.setOption(option_25a219fdab944c42a2859090047ad97a);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x111423c40>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar\n",
    "from pyecharts.faker import Faker\n",
    "from pyecharts.globals import ThemeType\n",
    "\n",
    "labels = Faker.choose() # 标签\n",
    "x1 = Faker.values()\n",
    "x2 = Faker.values()\n",
    "c = (\n",
    "    #Bar()\n",
    "    Bar({\"theme\": ThemeType.MACARONS})\n",
    "    .add_xaxis(labels)\n",
    "    .add_yaxis(\"商家A\", x1 )\n",
    "    .add_yaxis(\"商家B\", x2 )\n",
    "    #.reversal_axis()\n",
    "    #.set_series_opts(label_opts=opts.LabelOpts(position=\"right\"))\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"柱状图实例\", subtitle=\"我是副标题\"),\n",
    "        brush_opts=opts.BrushOpts(),\n",
    "    )\n",
    ")\n",
    "\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "id": "c49e5132",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"eef87341fe7e46068eff7ec216d53a55\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_eef87341fe7e46068eff7ec216d53a55 = echarts.init(\n",
       "                    document.getElementById('eef87341fe7e46068eff7ec216d53a55'), 'white', {renderer: 'canvas'});\n",
       "                var option_eef87341fe7e46068eff7ec216d53a55 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"product1\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"value\": 12,\n",
       "                    \"percent\": 0.8\n",
       "                },\n",
       "                {\n",
       "                    \"value\": 23,\n",
       "                    \"percent\": 0.5227272727272727\n",
       "                },\n",
       "                {\n",
       "                    \"value\": 33,\n",
       "                    \"percent\": 0.868421052631579\n",
       "                },\n",
       "                {\n",
       "                    \"value\": 3,\n",
       "                    \"percent\": 0.05454545454545454\n",
       "                },\n",
       "                {\n",
       "                    \"value\": 33,\n",
       "                    \"percent\": 0.4342105263157895\n",
       "                }\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"stack\": \"stack1\",\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"50%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"right\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": function(x){return Number(x.data.percent * 100).toFixed() + '%';}\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"product2\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"value\": 3,\n",
       "                    \"percent\": 0.2\n",
       "                },\n",
       "                {\n",
       "                    \"value\": 21,\n",
       "                    \"percent\": 0.4772727272727273\n",
       "                },\n",
       "                {\n",
       "                    \"value\": 5,\n",
       "                    \"percent\": 0.13157894736842105\n",
       "                },\n",
       "                {\n",
       "                    \"value\": 52,\n",
       "                    \"percent\": 0.9454545454545454\n",
       "                },\n",
       "                {\n",
       "                    \"value\": 43,\n",
       "                    \"percent\": 0.5657894736842105\n",
       "                }\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"stack\": \"stack1\",\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"50%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"right\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": function(x){return Number(x.data.percent * 100).toFixed() + '%';}\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"product1\",\n",
       "                \"product2\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"product1\": true,\n",
       "                \"product2\": true\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                1,\n",
       "                2,\n",
       "                3,\n",
       "                4,\n",
       "                5\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_eef87341fe7e46068eff7ec216d53a55.setOption(option_eef87341fe7e46068eff7ec216d53a55);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1339acc10>"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar\n",
    "from pyecharts.commons.utils import JsCode\n",
    "from pyecharts.globals import ThemeType\n",
    "\n",
    "list2 = [\n",
    "    {\"value\": 12, \"percent\": 12 / (12 + 3)},\n",
    "    {\"value\": 23, \"percent\": 23 / (23 + 21)},\n",
    "    {\"value\": 33, \"percent\": 33 / (33 + 5)},\n",
    "    {\"value\": 3, \"percent\": 3 / (3 + 52)},\n",
    "    {\"value\": 33, \"percent\": 33 / (33 + 43)},\n",
    "]\n",
    "\n",
    "list3 = [\n",
    "    {\"value\": 3, \"percent\": 3 / (12 + 3)},\n",
    "    {\"value\": 21, \"percent\": 21 / (23 + 21)},\n",
    "    {\"value\": 5, \"percent\": 5 / (33 + 5)},\n",
    "    {\"value\": 52, \"percent\": 52 / (3 + 52)},\n",
    "    {\"value\": 43, \"percent\": 43 / (33 + 43)},\n",
    "]\n",
    "\n",
    "labels = [1, 2, 3, 4, 5]\n",
    "c = (\n",
    "    #Bar(init_opts=opts.InitOpts(theme=ThemeType.LIGHT))\n",
    "    Bar()\n",
    "    .add_xaxis(labels)\n",
    "    .add_yaxis(\"product1\", list2, stack=\"stack1\", category_gap=\"50%\")\n",
    "    .add_yaxis(\"product2\", list3, stack=\"stack1\", category_gap=\"50%\")\n",
    "    .set_series_opts(\n",
    "        label_opts=opts.LabelOpts(\n",
    "            position=\"right\",\n",
    "            formatter=JsCode(\n",
    "                \"function(x){return Number(x.data.percent * 100).toFixed() + '%';}\"\n",
    "            ),\n",
    "        )\n",
    "    )\n",
    ")\n",
    "\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6694dae7",
   "metadata": {},
   "source": [
    "### 散点图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "b9e74564",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"87c5e699f1ce4c19a66059958acf1893\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_87c5e699f1ce4c19a66059958acf1893 = echarts.init(\n",
       "                    document.getElementById('87c5e699f1ce4c19a66059958acf1893'), 'white', {renderer: 'canvas'});\n",
       "                var option_87c5e699f1ce4c19a66059958acf1893 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"name\": \"\\u5546\\u5bb6A\",\n",
       "            \"symbolSize\": 10,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u5468\\u4e00\",\n",
       "                    35\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e8c\",\n",
       "                    46\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e09\",\n",
       "                    82\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u56db\",\n",
       "                    149\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e94\",\n",
       "                    33\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u516d\",\n",
       "                    37\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u65e5\",\n",
       "                    61\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"right\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"name\": \"\\u5546\\u5bb6B\",\n",
       "            \"symbolSize\": 10,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u5468\\u4e00\",\n",
       "                    119\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e8c\",\n",
       "                    47\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e09\",\n",
       "                    28\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u56db\",\n",
       "                    45\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e94\",\n",
       "                    143\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u516d\",\n",
       "                    26\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u65e5\",\n",
       "                    33\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"right\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5546\\u5bb6A\",\n",
       "                \"\\u5546\\u5bb6B\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5546\\u5bb6A\": true,\n",
       "                \"\\u5546\\u5bb6B\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u5468\\u4e00\",\n",
       "                \"\\u5468\\u4e8c\",\n",
       "                \"\\u5468\\u4e09\",\n",
       "                \"\\u5468\\u56db\",\n",
       "                \"\\u5468\\u4e94\",\n",
       "                \"\\u5468\\u516d\",\n",
       "                \"\\u5468\\u65e5\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": true,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Scatter-VisualMap(Size)\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"visualMap\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"continuous\",\n",
       "        \"min\": 20,\n",
       "        \"max\": 150,\n",
       "        \"inRange\": {\n",
       "            \"symbolSize\": [\n",
       "                20,\n",
       "                50\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"inverse\": false,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"showLabel\": true,\n",
       "        \"itemWidth\": 20,\n",
       "        \"itemHeight\": 140,\n",
       "        \"borderWidth\": 0\n",
       "    }\n",
       "};\n",
       "                chart_87c5e699f1ce4c19a66059958acf1893.setOption(option_87c5e699f1ce4c19a66059958acf1893);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x108b94940>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Scatter\n",
    "from pyecharts.faker import Faker\n",
    "labels = Faker.choose()\n",
    "y1 = Faker.values()\n",
    "y2 = Faker.values()\n",
    "c = (\n",
    "    Scatter()\n",
    "    .add_xaxis(labels)\n",
    "    .add_yaxis(\"商家A\", y1)\n",
    "    .add_yaxis(\"商家B\", y2)\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"Scatter-VisualMap(Size)\"),\n",
    "        visualmap_opts=opts.VisualMapOpts(type_=\"size\", max_=150, min_=20),\n",
    "        # 网格\n",
    "        # xaxis_opts=opts.AxisOpts(splitline_opts=opts.SplitLineOpts(is_show=True)),\n",
    "        yaxis_opts=opts.AxisOpts(splitline_opts=opts.SplitLineOpts(is_show=True)),\n",
    "\n",
    "    )\n",
    ")\n",
    "\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6b02db81",
   "metadata": {},
   "source": [
    "### 漏斗图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "c5a22179",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"074a9d5e6a624feaa8222ed801603929\" style=\"width:800px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_074a9d5e6a624feaa8222ed801603929 = echarts.init(\n",
       "                    document.getElementById('074a9d5e6a624feaa8222ed801603929'), 'white', {renderer: 'canvas'});\n",
       "                var option_074a9d5e6a624feaa8222ed801603929 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"funnel\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5c55\\u73b0\",\n",
       "                    \"value\": 90\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u70b9\\u51fb\",\n",
       "                    \"value\": 80\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8bbf\\u95ee\",\n",
       "                    \"value\": 50\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u54a8\\u8be2\",\n",
       "                    \"value\": 40\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8ba2\\u5355\",\n",
       "                    \"value\": 20\n",
       "                }\n",
       "            ],\n",
       "            \"sort\": \"descending\",\n",
       "            \"gap\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"inside\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"showContent\": true,\n",
       "                \"alwaysShowContent\": false,\n",
       "                \"showDelay\": 0,\n",
       "                \"hideDelay\": 100,\n",
       "                \"formatter\": \"{a} <br/>{b} : {c}%\",\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0,\n",
       "                \"padding\": 5\n",
       "            },\n",
       "            \"itemStyle\": {\n",
       "                \"borderColor\": \"#fff\",\n",
       "                \"borderWidth\": 1\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u70b9\\u51fb\",\n",
       "                \"\\u54a8\\u8be2\",\n",
       "                \"\\u5c55\\u73b0\",\n",
       "                \"\\u8bbf\\u95ee\",\n",
       "                \"\\u8ba2\\u5355\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5c55\\u73b0\": true,\n",
       "                \"\\u70b9\\u51fb\": true,\n",
       "                \"\\u8bbf\\u95ee\": true,\n",
       "                \"\\u54a8\\u8be2\": true,\n",
       "                \"\\u8ba2\\u5355\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u6f0f\\u6597\\u56fe\",\n",
       "            \"subtext\": \"\\u7eaf\\u5c5e\\u865a\\u6784\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_074a9d5e6a624feaa8222ed801603929.setOption(option_074a9d5e6a624feaa8222ed801603929);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x108b94040>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pyecharts.options as opts\n",
    "from pyecharts.charts import Funnel\n",
    "\n",
    "\n",
    "x_data = [\"展现\", \"点击\", \"访问\", \"咨询\", \"订单\"]\n",
    "y_data = [90, 80, 50, 40, 20]\n",
    "\n",
    "data = [[x_data[i], y_data[i]] for i in range(len(x_data))]\n",
    "\n",
    "c = (\n",
    "    Funnel(init_opts=opts.InitOpts(width=\"800px\", height=\"500px\"))\n",
    "    .add(\n",
    "        series_name=\"\",\n",
    "        data_pair=data,\n",
    "        gap=2,\n",
    "        tooltip_opts=opts.TooltipOpts(trigger=\"item\", formatter=\"{a} <br/>{b} : {c}%\"),\n",
    "        label_opts=opts.LabelOpts(is_show=True, position=\"inside\"),\n",
    "        itemstyle_opts=opts.ItemStyleOpts(border_color=\"#fff\", border_width=1),\n",
    "    )\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"漏斗图\", subtitle=\"纯属虚构\"))\n",
    ")\n",
    "\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "12b49d8e",
   "metadata": {},
   "source": [
    "### 折线图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "id": "56aeee1a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"87828b2a0b114e6ca25c4d4ceee1cdfc\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_87828b2a0b114e6ca25c4d4ceee1cdfc = echarts.init(\n",
       "                    document.getElementById('87828b2a0b114e6ca25c4d4ceee1cdfc'), 'white', {renderer: 'canvas'});\n",
       "                var option_87828b2a0b114e6ca25c4d4ceee1cdfc = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u6700\\u9ad8\\u6c14\\u6e29\",\n",
       "            \"connectNulls\": false,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"clip\": true,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u5468\\u4e00\",\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e8c\",\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e09\",\n",
       "                    15\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u56db\",\n",
       "                    13\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e94\",\n",
       "                    12\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u516d\",\n",
       "                    13\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u65e5\",\n",
       "                    10\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"inside\",\n",
       "                    \"color\": \"#fff\",\n",
       "                    \"margin\": 8\n",
       "                },\n",
       "                \"data\": [\n",
       "                    {\n",
       "                        \"name\": \"\\u6700\\u5927\\u503c\",\n",
       "                        \"type\": \"max\"\n",
       "                    },\n",
       "                    {\n",
       "                        \"name\": \"\\u6700\\u5c0f\\u503c\",\n",
       "                        \"type\": \"min\"\n",
       "                    }\n",
       "                ]\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"silent\": false,\n",
       "                \"precision\": 2,\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"margin\": 8\n",
       "                },\n",
       "                \"data\": [\n",
       "                    {\n",
       "                        \"name\": \"\\u5e73\\u5747\\u503c\",\n",
       "                        \"type\": \"average\"\n",
       "                    }\n",
       "                ]\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u6700\\u4f4e\\u6e29\\u5ea6\",\n",
       "            \"connectNulls\": false,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": true,\n",
       "            \"clip\": true,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u5468\\u4e00\",\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e8c\",\n",
       "                    -2\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e09\",\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u56db\",\n",
       "                    5\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e94\",\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u516d\",\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u65e5\",\n",
       "                    0\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u6700\\u9ad8\\u6c14\\u6e29\",\n",
       "                \"\\u6700\\u4f4e\\u6e29\\u5ea6\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u6700\\u9ad8\\u6c14\\u6e29\": true,\n",
       "                \"\\u6700\\u4f4e\\u6e29\\u5ea6\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u5468\\u4e00\",\n",
       "                \"\\u5468\\u4e8c\",\n",
       "                \"\\u5468\\u4e09\",\n",
       "                \"\\u5468\\u56db\",\n",
       "                \"\\u5468\\u4e94\",\n",
       "                \"\\u5468\\u516d\",\n",
       "                \"\\u5468\\u65e5\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u6298\\u7ebf\\u56fe\\u4f8b\",\n",
       "            \"subtext\": \"\\u6298\\u7ebf\\u6f14\\u793a\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_87828b2a0b114e6ca25c4d4ceee1cdfc.setOption(option_87828b2a0b114e6ca25c4d4ceee1cdfc);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1339ac970>"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pyecharts.options as opts\n",
    "from pyecharts.charts import Line\n",
    "from pyecharts.faker import Faker\n",
    "\n",
    "week_name_list = [\"周一\", \"周二\", \"周三\", \"周四\", \"周五\", \"周六\", \"周日\"]\n",
    "x1 = [11, 11, 15, 13, 12, 13, 10]\n",
    "x2 = [1, -2, 2, 5, 3, 2, 0]\n",
    "\n",
    "c = (\n",
    "    Line()\n",
    "    .add_xaxis(week_name_list)\n",
    "    .add_yaxis(\n",
    "        series_name=\"最高气温\",\n",
    "        y_axis= x1,\n",
    "        markpoint_opts=opts.MarkPointOpts(\n",
    "            data=[\n",
    "                opts.MarkPointItem(type_=\"max\", name=\"最大值\"),\n",
    "                opts.MarkPointItem(type_=\"min\", name=\"最小值\"),\n",
    "            ]\n",
    "        ),\n",
    "        markline_opts=opts.MarkLineOpts(\n",
    "            data=[opts.MarkLineItem(type_=\"average\", name=\"平均值\")]\n",
    "        ),\n",
    "    )\n",
    "    #.add_yaxis(\"最低温度\", x1, areastyle_opts=opts.AreaStyleOpts(opacity=0.5))\n",
    "    .add_yaxis(\"最低温度\", x2, is_smooth=True)\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"折线图例\",subtitle=\"折线演示\"))\n",
    ")\n",
    "\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1767b04f",
   "metadata": {},
   "source": [
    "### 饼图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "12b13639",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[['衬衫', 64], ['毛衣', 96], ['领带', 65], ['裤子', 138], ['风衣', 139], ['高跟鞋', 129], ['袜子', 128]]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"7479b9efaa5448babbf6ea240a7652e4\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_7479b9efaa5448babbf6ea240a7652e4 = echarts.init(\n",
       "                    document.getElementById('7479b9efaa5448babbf6ea240a7652e4'), 'white', {renderer: 'canvas'});\n",
       "                var option_7479b9efaa5448babbf6ea240a7652e4 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u886c\\u886b\",\n",
       "                    \"value\": 64\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6bdb\\u8863\",\n",
       "                    \"value\": 96\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9886\\u5e26\",\n",
       "                    \"value\": 65\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u88e4\\u5b50\",\n",
       "                    \"value\": 138\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u98ce\\u8863\",\n",
       "                    \"value\": 139\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9ad8\\u8ddf\\u978b\",\n",
       "                    \"value\": 129\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u889c\\u5b50\",\n",
       "                    \"value\": 128\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"0%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}: {c}\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u886c\\u886b\",\n",
       "                \"\\u6bdb\\u8863\",\n",
       "                \"\\u9886\\u5e26\",\n",
       "                \"\\u88e4\\u5b50\",\n",
       "                \"\\u98ce\\u8863\",\n",
       "                \"\\u9ad8\\u8ddf\\u978b\",\n",
       "                \"\\u889c\\u5b50\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Pie-\\u57fa\\u672c\\u793a\\u4f8b\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_7479b9efaa5448babbf6ea240a7652e4.setOption(option_7479b9efaa5448babbf6ea240a7652e4);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x108f110a0>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Pie\n",
    "from pyecharts.faker import Faker\n",
    "x =  [list(z) for z in zip(Faker.choose(), Faker.values())]\n",
    "print(x)\n",
    "c = (\n",
    "    Pie()\n",
    "    .add(\"\",x )\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"Pie-基本示例\"))\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}: {c}\"))\n",
    ")\n",
    "\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "fc8f81c5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"6d69085fae9d44029058d6d967e5db24\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_6d69085fae9d44029058d6d967e5db24 = echarts.init(\n",
       "                    document.getElementById('6d69085fae9d44029058d6d967e5db24'), 'white', {renderer: 'canvas'});\n",
       "                var option_6d69085fae9d44029058d6d967e5db24 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u8349\\u8393\",\n",
       "                    \"value\": 101\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8292\\u679c\",\n",
       "                    \"value\": 85\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8461\\u8404\",\n",
       "                    \"value\": 94\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u96ea\\u68a8\",\n",
       "                    \"value\": 53\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u897f\\u74dc\",\n",
       "                    \"value\": 112\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u67e0\\u6aac\",\n",
       "                    \"value\": 84\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8f66\\u5398\\u5b50\",\n",
       "                    \"value\": 118\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"35%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}: {c}\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u8349\\u8393\",\n",
       "                \"\\u8292\\u679c\",\n",
       "                \"\\u8461\\u8404\",\n",
       "                \"\\u96ea\\u68a8\",\n",
       "                \"\\u897f\\u74dc\",\n",
       "                \"\\u67e0\\u6aac\",\n",
       "                \"\\u8f66\\u5398\\u5b50\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"left\": \"2%\",\n",
       "            \"top\": \"15%\",\n",
       "            \"orient\": \"vertical\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Pie-Radius\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_6d69085fae9d44029058d6d967e5db24.setOption(option_6d69085fae9d44029058d6d967e5db24);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x108b94970>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Pie\n",
    "from pyecharts.faker import Faker\n",
    "\n",
    "c = (\n",
    "    Pie()\n",
    "    .add(\n",
    "        \"\",\n",
    "        [list(z) for z in zip(Faker.choose(), Faker.values())],\n",
    "        radius=[\"35%\", \"75%\"],\n",
    "    )\n",
    "    # .set_colors([\"blue\", \"green\", \"yellow\", \"red\", \"pink\", \"orange\", \"purple\"])\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"Pie-Radius\"),\n",
    "        legend_opts=opts.LegendOpts(orient=\"vertical\", pos_top=\"15%\", pos_left=\"2%\"),\n",
    "    )\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}: {c}\"))\n",
    ")\n",
    "\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f8e35798",
   "metadata": {},
   "source": [
    "### 雷达图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "968cd7cc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"3a7b5ea1378849d5aa9bea96ec210cb0\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_3a7b5ea1378849d5aa9bea96ec210cb0 = echarts.init(\n",
       "                    document.getElementById('3a7b5ea1378849d5aa9bea96ec210cb0'), 'white', {renderer: 'canvas'});\n",
       "                var option_3a7b5ea1378849d5aa9bea96ec210cb0 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"radar\",\n",
       "            \"name\": \"\\u9884\\u7b97\\u5206\\u914d\",\n",
       "            \"data\": [\n",
       "                [\n",
       "                    4300,\n",
       "                    10000,\n",
       "                    28000,\n",
       "                    35000,\n",
       "                    50000,\n",
       "                    19000\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"itemStyle\": {\n",
       "                \"normal\": {}\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"radar\",\n",
       "            \"name\": \"\\u5b9e\\u9645\\u5f00\\u9500\",\n",
       "            \"data\": [\n",
       "                [\n",
       "                    5000,\n",
       "                    14000,\n",
       "                    28000,\n",
       "                    31000,\n",
       "                    42000,\n",
       "                    21000\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"itemStyle\": {\n",
       "                \"normal\": {}\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u9884\\u7b97\\u5206\\u914d\",\n",
       "                \"\\u5b9e\\u9645\\u5f00\\u9500\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u9884\\u7b97\\u5206\\u914d\": true,\n",
       "                \"\\u5b9e\\u9645\\u5f00\\u9500\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"radar\": {\n",
       "        \"indicator\": [\n",
       "            {\n",
       "                \"name\": \"\\u9500\\u552e\",\n",
       "                \"max\": 6500\n",
       "            },\n",
       "            {\n",
       "                \"name\": \"\\u7ba1\\u7406\",\n",
       "                \"max\": 16000\n",
       "            },\n",
       "            {\n",
       "                \"name\": \"\\u4fe1\\u606f\\u6280\\u672f\",\n",
       "                \"max\": 30000\n",
       "            },\n",
       "            {\n",
       "                \"name\": \"\\u5ba2\\u670d\",\n",
       "                \"max\": 38000\n",
       "            },\n",
       "            {\n",
       "                \"name\": \"\\u7814\\u53d1\",\n",
       "                \"max\": 52000\n",
       "            },\n",
       "            {\n",
       "                \"name\": \"\\u5e02\\u573a\",\n",
       "                \"max\": 25000\n",
       "            }\n",
       "        ],\n",
       "        \"name\": {\n",
       "            \"textStyle\": {}\n",
       "        },\n",
       "        \"splitLine\": {\n",
       "            \"show\": true,\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            }\n",
       "        },\n",
       "        \"splitArea\": {\n",
       "            \"show\": true,\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            }\n",
       "        },\n",
       "        \"axisLine\": {\n",
       "            \"show\": true,\n",
       "            \"onZero\": true,\n",
       "            \"onZeroAxisIndex\": 0\n",
       "        }\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Radar-\\u5355\\u4f8b\\u6a21\\u5f0f\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_3a7b5ea1378849d5aa9bea96ec210cb0.setOption(option_3a7b5ea1378849d5aa9bea96ec210cb0);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x108b94580>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Radar\n",
    "\n",
    "v1 = [[4300, 10000, 28000, 35000, 50000, 19000]]\n",
    "v2 = [[5000, 14000, 28000, 31000, 42000, 21000]]\n",
    "c = (\n",
    "    Radar()\n",
    "    .add_schema(\n",
    "        schema=[\n",
    "            opts.RadarIndicatorItem(name=\"销售\", max_=6500),\n",
    "            opts.RadarIndicatorItem(name=\"管理\", max_=16000),\n",
    "            opts.RadarIndicatorItem(name=\"信息技术\", max_=30000),\n",
    "            opts.RadarIndicatorItem(name=\"客服\", max_=38000),\n",
    "            opts.RadarIndicatorItem(name=\"研发\", max_=52000),\n",
    "            opts.RadarIndicatorItem(name=\"市场\", max_=25000),\n",
    "        ]\n",
    "    )\n",
    "    .add(\"预算分配\", v1)\n",
    "    .add(\"实际开销\", v2)\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(is_show=False))\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"Radar-单例模式\"),\n",
    "    )\n",
    ")\n",
    "\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c8669f43",
   "metadata": {},
   "source": [
    "###  组合图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "b0bdd8a2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"5ea352f523fa43179922de30da61f0ba\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_5ea352f523fa43179922de30da61f0ba = echarts.init(\n",
       "                    document.getElementById('5ea352f523fa43179922de30da61f0ba'), 'white', {renderer: 'canvas'});\n",
       "                var option_5ea352f523fa43179922de30da61f0ba = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5546\\u5bb6A\",\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 0,\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                131,\n",
       "                23,\n",
       "                92,\n",
       "                130,\n",
       "                123,\n",
       "                121,\n",
       "                131\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5546\\u5bb6B\",\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 0,\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                69,\n",
       "                114,\n",
       "                118,\n",
       "                33,\n",
       "                32,\n",
       "                54,\n",
       "                68\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5546\\u5bb6A\",\n",
       "            \"connectNulls\": false,\n",
       "            \"xAxisIndex\": 1,\n",
       "            \"yAxisIndex\": 1,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"clip\": true,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u53ef\\u4e50\",\n",
       "                    43\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u96ea\\u78a7\",\n",
       "                    39\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u6a59\\u6c41\",\n",
       "                    100\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u7eff\\u8336\",\n",
       "                    71\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5976\\u8336\",\n",
       "                    104\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u767e\\u5a01\",\n",
       "                    68\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u9752\\u5c9b\",\n",
       "                    66\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5546\\u5bb6B\",\n",
       "            \"connectNulls\": false,\n",
       "            \"xAxisIndex\": 1,\n",
       "            \"yAxisIndex\": 1,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"clip\": true,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u53ef\\u4e50\",\n",
       "                    35\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u96ea\\u78a7\",\n",
       "                    142\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u6a59\\u6c41\",\n",
       "                    87\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u7eff\\u8336\",\n",
       "                    88\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5976\\u8336\",\n",
       "                    133\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u767e\\u5a01\",\n",
       "                    65\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u9752\\u5c9b\",\n",
       "                    141\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5546\\u5bb6A\",\n",
       "                \"\\u5546\\u5bb6B\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5546\\u5bb6A\": true,\n",
       "                \"\\u5546\\u5bb6B\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        },\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5546\\u5bb6A\",\n",
       "                \"\\u5546\\u5bb6B\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5546\\u5bb6A\": true,\n",
       "                \"\\u5546\\u5bb6B\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"top\": \"48%\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u6cb3\\u9a6c\",\n",
       "                \"\\u87d2\\u86c7\",\n",
       "                \"\\u8001\\u864e\",\n",
       "                \"\\u5927\\u8c61\",\n",
       "                \"\\u5154\\u5b50\",\n",
       "                \"\\u718a\\u732b\",\n",
       "                \"\\u72ee\\u5b50\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 1,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u53ef\\u4e50\",\n",
       "                \"\\u96ea\\u78a7\",\n",
       "                \"\\u6a59\\u6c41\",\n",
       "                \"\\u7eff\\u8336\",\n",
       "                \"\\u5976\\u8336\",\n",
       "                \"\\u767e\\u5a01\",\n",
       "                \"\\u9752\\u5c9b\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 1,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Grid-Bar\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        },\n",
       "        {\n",
       "            \"text\": \"Grid-Line\",\n",
       "            \"top\": \"48%\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"grid\": [\n",
       "        {\n",
       "            \"show\": false,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"left\": \"55%\",\n",
       "            \"containLabel\": false,\n",
       "            \"backgroundColor\": \"transparent\",\n",
       "            \"borderColor\": \"#ccc\",\n",
       "            \"borderWidth\": 1\n",
       "        },\n",
       "        {\n",
       "            \"show\": false,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"right\": \"55%\",\n",
       "            \"containLabel\": false,\n",
       "            \"backgroundColor\": \"transparent\",\n",
       "            \"borderColor\": \"#ccc\",\n",
       "            \"borderWidth\": 1\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_5ea352f523fa43179922de30da61f0ba.setOption(option_5ea352f523fa43179922de30da61f0ba);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x108f47760>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar, Grid, Line\n",
    "from pyecharts.faker import Faker\n",
    "\n",
    "bar = (\n",
    "    Bar()\n",
    "    .add_xaxis(Faker.choose())\n",
    "    .add_yaxis(\"商家A\", Faker.values())\n",
    "    .add_yaxis(\"商家B\", Faker.values())\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"Grid-Bar\"))\n",
    ")\n",
    "line = (\n",
    "    Line()\n",
    "    .add_xaxis(Faker.choose())\n",
    "    .add_yaxis(\"商家A\", Faker.values())\n",
    "    .add_yaxis(\"商家B\", Faker.values())\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"Grid-Line\", pos_top=\"48%\"),\n",
    "        legend_opts=opts.LegendOpts(pos_top=\"48%\"),\n",
    "    )\n",
    ")\n",
    "\n",
    "grid = (\n",
    "    Grid()\n",
    "    #.add(bar, grid_opts=opts.GridOpts(pos_bottom=\"60%\"))\n",
    "    #.add(line, grid_opts=opts.GridOpts(pos_top=\"60%\"))\n",
    "    .add(bar, grid_opts=opts.GridOpts(pos_left=\"55%\"))\n",
    "    .add(line, grid_opts=opts.GridOpts(pos_right=\"55%\"))\n",
    ")\n",
    "\n",
    "grid.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "c290e132",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"d07ff7c270c84eeb8b471a27671d07cd\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_d07ff7c270c84eeb8b471a27671d07cd = echarts.init(\n",
       "                    document.getElementById('d07ff7c270c84eeb8b471a27671d07cd'), 'white', {renderer: 'canvas'});\n",
       "                var option_d07ff7c270c84eeb8b471a27671d07cd = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#5793f3\",\n",
       "        \"#d14a61\",\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u84b8\\u53d1\\u91cf\",\n",
       "            \"yAxisIndex\": 0,\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                2.0,\n",
       "                4.9,\n",
       "                7.0,\n",
       "                23.2,\n",
       "                25.6,\n",
       "                76.7,\n",
       "                135.6,\n",
       "                162.2,\n",
       "                32.6,\n",
       "                20.0,\n",
       "                6.4,\n",
       "                3.3\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u964d\\u6c34\\u91cf\",\n",
       "            \"yAxisIndex\": 1,\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                2.6,\n",
       "                5.9,\n",
       "                9.0,\n",
       "                26.4,\n",
       "                28.7,\n",
       "                70.7,\n",
       "                175.6,\n",
       "                182.2,\n",
       "                48.7,\n",
       "                18.8,\n",
       "                6.0,\n",
       "                2.3\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5e73\\u5747\\u6e29\\u5ea6\",\n",
       "            \"connectNulls\": false,\n",
       "            \"yAxisIndex\": 2,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"clip\": true,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u6708\",\n",
       "                    2.0\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u6708\",\n",
       "                    2.2\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u6708\",\n",
       "                    3.3\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u6708\",\n",
       "                    4.5\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u6708\",\n",
       "                    6.3\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u6708\",\n",
       "                    10.2\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u6708\",\n",
       "                    20.3\n",
       "                ],\n",
       "                [\n",
       "                    \"8\\u6708\",\n",
       "                    23.4\n",
       "                ],\n",
       "                [\n",
       "                    \"9\\u6708\",\n",
       "                    23.0\n",
       "                ],\n",
       "                [\n",
       "                    \"10\\u6708\",\n",
       "                    16.5\n",
       "                ],\n",
       "                [\n",
       "                    \"11\\u6708\",\n",
       "                    12.0\n",
       "                ],\n",
       "                [\n",
       "                    \"12\\u6708\",\n",
       "                    6.2\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u84b8\\u53d1\\u91cf\",\n",
       "                \"\\u964d\\u6c34\\u91cf\",\n",
       "                \"\\u5e73\\u5747\\u6e29\\u5ea6\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u84b8\\u53d1\\u91cf\": true,\n",
       "                \"\\u964d\\u6c34\\u91cf\": true,\n",
       "                \"\\u5e73\\u5747\\u6e29\\u5ea6\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"axis\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"cross\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"1\\u6708\",\n",
       "                \"2\\u6708\",\n",
       "                \"3\\u6708\",\n",
       "                \"4\\u6708\",\n",
       "                \"5\\u6708\",\n",
       "                \"6\\u6708\",\n",
       "                \"7\\u6708\",\n",
       "                \"8\\u6708\",\n",
       "                \"9\\u6708\",\n",
       "                \"10\\u6708\",\n",
       "                \"11\\u6708\",\n",
       "                \"12\\u6708\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u964d\\u6c34\\u91cf\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLine\": {\n",
       "                \"show\": true,\n",
       "                \"onZero\": true,\n",
       "                \"onZeroAxisIndex\": 0,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"color\": \"#5793f3\"\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{value} ml\"\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"position\": \"right\",\n",
       "            \"offset\": 80,\n",
       "            \"splitNumber\": 5,\n",
       "            \"min\": 0,\n",
       "            \"max\": 250,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"value\",\n",
       "            \"name\": \"\\u84b8\\u53d1\\u91cf\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLine\": {\n",
       "                \"show\": true,\n",
       "                \"onZero\": true,\n",
       "                \"onZeroAxisIndex\": 0,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"color\": \"#d14a61\"\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{value} ml\"\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"position\": \"right\",\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"min\": 0,\n",
       "            \"max\": 250,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"value\",\n",
       "            \"name\": \"\\u6e29\\u5ea6\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLine\": {\n",
       "                \"show\": true,\n",
       "                \"onZero\": true,\n",
       "                \"onZeroAxisIndex\": 0,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"color\": \"#675bba\"\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{value} \\u00b0C\"\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"position\": \"left\",\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"min\": 0,\n",
       "            \"max\": 25,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": true,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u96e8\\u91cf&\\u6e29\\u5ea6\\u5206\\u5e03\\u8d8b\\u52bf\\u56fe\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"grid\": [\n",
       "        {\n",
       "            \"show\": false,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"left\": \"5%\",\n",
       "            \"right\": \"20%\",\n",
       "            \"containLabel\": false,\n",
       "            \"backgroundColor\": \"transparent\",\n",
       "            \"borderColor\": \"#ccc\",\n",
       "            \"borderWidth\": 1\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_d07ff7c270c84eeb8b471a27671d07cd.setOption(option_d07ff7c270c84eeb8b471a27671d07cd);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x108f47670>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar, Grid, Line\n",
    "\n",
    "x_data = [\"{}月\".format(i) for i in range(1, 13)]\n",
    "\n",
    "bar = (\n",
    "    Bar()\n",
    "    .add_xaxis(x_data)\n",
    "    .add_yaxis(\n",
    "        \"蒸发量\",\n",
    "        [2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3],\n",
    "        yaxis_index=0,\n",
    "        color=\"#d14a61\",\n",
    "    )\n",
    "    .add_yaxis(\n",
    "        \"降水量\",\n",
    "        [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3],\n",
    "        yaxis_index=1,\n",
    "        color=\"#5793f3\",\n",
    "    )\n",
    "    .extend_axis( # 扩展坐标轴 - 蒸发量\n",
    "        yaxis=opts.AxisOpts(\n",
    "            name=\"蒸发量\",\n",
    "            type_=\"value\",\n",
    "            min_=0,\n",
    "            max_=250,\n",
    "            position=\"right\",\n",
    "            axisline_opts=opts.AxisLineOpts(\n",
    "                linestyle_opts=opts.LineStyleOpts(color=\"#d14a61\")\n",
    "            ),\n",
    "            axislabel_opts=opts.LabelOpts(formatter=\"{value} ml\"),\n",
    "        )\n",
    "    )\n",
    "    .extend_axis(# 扩展坐标轴 - 温度\n",
    "        yaxis=opts.AxisOpts(\n",
    "            type_=\"value\",\n",
    "            name=\"温度\",\n",
    "            min_=0,\n",
    "            max_=25,\n",
    "            position=\"left\",\n",
    "            axisline_opts=opts.AxisLineOpts(\n",
    "                linestyle_opts=opts.LineStyleOpts(color=\"#675bba\")\n",
    "            ),\n",
    "            axislabel_opts=opts.LabelOpts(formatter=\"{value} °C\"),\n",
    "            splitline_opts=opts.SplitLineOpts(\n",
    "                is_show=True, linestyle_opts=opts.LineStyleOpts(opacity=1)\n",
    "            ),\n",
    "        )\n",
    "    )\n",
    "    .set_global_opts(# 扩展坐标轴 - 降水量\n",
    "        yaxis_opts=opts.AxisOpts(\n",
    "            name=\"降水量\",\n",
    "            min_=0,\n",
    "            max_=250,\n",
    "            position=\"right\",\n",
    "            offset=80,\n",
    "            axisline_opts=opts.AxisLineOpts(\n",
    "                linestyle_opts=opts.LineStyleOpts(color=\"#5793f3\")\n",
    "            ),\n",
    "            axislabel_opts=opts.LabelOpts(formatter=\"{value} ml\"),\n",
    "        ),\n",
    "        title_opts=opts.TitleOpts(title=\"雨量&温度分布趋势图\"),\n",
    "        tooltip_opts=opts.TooltipOpts(trigger=\"axis\", axis_pointer_type=\"cross\"),\n",
    "    )\n",
    ")\n",
    "\n",
    "line = (\n",
    "    Line()\n",
    "    .add_xaxis(x_data)\n",
    "    .add_yaxis(\n",
    "        \"平均温度\",\n",
    "        [2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2],\n",
    "        yaxis_index=2,\n",
    "        color=\"#675bba\",\n",
    "        label_opts=opts.LabelOpts(is_show=True),\n",
    "    )\n",
    ")\n",
    "\n",
    "bar.overlap(line) # 重叠\n",
    "grid = Grid()\n",
    "grid.add(bar, opts.GridOpts(pos_left=\"5%\", pos_right=\"20%\"), is_control_axis_index=True)\n",
    "grid.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "62c9c501",
   "metadata": {},
   "source": [
    "### 地图\n",
    "#### 中国地图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "a29b62c7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[['广东', 133], ['北京', 133], ['上海', 83], ['江西', 109], ['湖南', 93], ['浙江', 92], ['江苏', 142]]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'china':'https://assets.pyecharts.org/assets/maps/china'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"ce937274a9d74643bb21433762a81294\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'china'], function(echarts) {\n",
       "                var chart_ce937274a9d74643bb21433762a81294 = echarts.init(\n",
       "                    document.getElementById('ce937274a9d74643bb21433762a81294'), 'white', {renderer: 'canvas'});\n",
       "                var option_ce937274a9d74643bb21433762a81294 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"map\",\n",
       "            \"name\": \"\\u5546\\u5bb6A\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"mapType\": \"china\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u4e1c\",\n",
       "                    \"value\": 133\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5317\\u4eac\",\n",
       "                    \"value\": 133\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e0a\\u6d77\",\n",
       "                    \"value\": 83\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u897f\",\n",
       "                    \"value\": 109\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5357\",\n",
       "                    \"value\": 93\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d59\\u6c5f\",\n",
       "                    \"value\": 92\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u82cf\",\n",
       "                    \"value\": 142\n",
       "                }\n",
       "            ],\n",
       "            \"roam\": true,\n",
       "            \"aspectScale\": 0.75,\n",
       "            \"nameProperty\": \"name\",\n",
       "            \"selectedMode\": false,\n",
       "            \"zoom\": 1,\n",
       "            \"mapValueCalculation\": \"sum\",\n",
       "            \"showLegendSymbol\": true,\n",
       "            \"emphasis\": {}\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5546\\u5bb6A\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5546\\u5bb6A\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Map-\\u57fa\\u672c\\u793a\\u4f8b\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_ce937274a9d74643bb21433762a81294.setOption(option_ce937274a9d74643bb21433762a81294);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x108f7a160>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Map\n",
    "from pyecharts.faker import Faker\n",
    "\n",
    "x = [list(z) for z in zip(Faker.provinces, Faker.values())]\n",
    "print(x)\n",
    "c = (\n",
    "    Map()\n",
    "    .add(\"商家A\",x , \"china\")\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"Map-基本示例\"))\n",
    ")\n",
    "\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9eed9b5b",
   "metadata": {},
   "source": [
    "#### 世界地图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "cf674ffe",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[['China', 85], ['Canada', 117], ['Brazil', 129], ['Russia', 66], ['United States', 142], ['Africa', 127], ['Germany', 125]]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'world':'https://assets.pyecharts.org/assets/maps/world'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"5d0ca3ab2d0b46b0835e634092d9d7da\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'world'], function(echarts) {\n",
       "                var chart_5d0ca3ab2d0b46b0835e634092d9d7da = echarts.init(\n",
       "                    document.getElementById('5d0ca3ab2d0b46b0835e634092d9d7da'), 'white', {renderer: 'canvas'});\n",
       "                var option_5d0ca3ab2d0b46b0835e634092d9d7da = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"map\",\n",
       "            \"name\": \"\\u5bfc\\u5f39\\u6570\\u91cf\",\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"mapType\": \"world\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"China\",\n",
       "                    \"value\": 85\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Canada\",\n",
       "                    \"value\": 117\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Brazil\",\n",
       "                    \"value\": 129\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Russia\",\n",
       "                    \"value\": 66\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"United States\",\n",
       "                    \"value\": 142\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Africa\",\n",
       "                    \"value\": 127\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Germany\",\n",
       "                    \"value\": 125\n",
       "                }\n",
       "            ],\n",
       "            \"roam\": true,\n",
       "            \"aspectScale\": 0.75,\n",
       "            \"nameProperty\": \"name\",\n",
       "            \"selectedMode\": false,\n",
       "            \"zoom\": 1,\n",
       "            \"mapValueCalculation\": \"sum\",\n",
       "            \"showLegendSymbol\": true,\n",
       "            \"emphasis\": {},\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5bfc\\u5f39\\u6570\\u91cf\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5bfc\\u5f39\\u6570\\u91cf\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Map-\\u4e16\\u754c\\u5730\\u56fe\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"visualMap\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"continuous\",\n",
       "        \"min\": 0,\n",
       "        \"max\": 200,\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"inverse\": false,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"showLabel\": true,\n",
       "        \"itemWidth\": 20,\n",
       "        \"itemHeight\": 140,\n",
       "        \"borderWidth\": 0\n",
       "    }\n",
       "};\n",
       "                chart_5d0ca3ab2d0b46b0835e634092d9d7da.setOption(option_5d0ca3ab2d0b46b0835e634092d9d7da);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x108b107c0>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Map\n",
    "from pyecharts.faker import Faker\n",
    "\n",
    "x = [list(z) for z in zip(Faker.country, Faker.values())]\n",
    "print(x)\n",
    "c = (\n",
    "    Map()\n",
    "    .add(\"导弹数量\", x, \"world\")\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(is_show=False))\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"Map-世界地图\"),\n",
    "        visualmap_opts=opts.VisualMapOpts(max_=200),\n",
    "    )\n",
    ")\n",
    "\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "32615092",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}